Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🐛 Bug]: IWebElement.Displayed throws 'HTMLFormElement' is undefined error in Selenium 4.25 #14540

Open
mannaci opened this issue Sep 26, 2024 · 3 comments

Comments

@mannaci
Copy link

mannaci commented Sep 26, 2024

What happened?

After upgrading from Selenium 4.23 to 4.25, the IWebElement.Displayed property is throwing a JavaScriptException with the message "'HTMLFormElement' is undefined" when used on certain elements. This behavior was not observed in the previous version. The element in question is not located within a

tag.

How can we reproduce the issue?

using OpenQA.Selenium;

string driverPath = Environment.GetEnvironmentVariable("RPA_DRIVER", EnvironmentVariableTarget.User);

var ieOptions = new InternetExplorerOptions()
{
    EdgeExecutablePath = @"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe",
    AttachToEdgeChrome = true,
    IntroduceInstabilityByIgnoringProtectedModeSettings = true,
    IgnoreZoomLevel = true,
};

InternetExplorerDriverService ieDriver = InternetExplorerDriverService.CreateDefaultService(driverPath);


ieDriver.LogFile = Path.Combine(@"C:\log\", "logs", "driver.log");

ieDriver.LoggingLevel = InternetExplorerDriverLogLevel.Trace;

ieDriver.SuppressInitialDiagnosticInformation = true;

var driver = new InternetExplorerDriver(ieDriver, ieOptions);
driver.Navigate().GoToUrl("xxxxxxx");
IWebElement d = driver.FindElement(By.XPath("/html/body/div[2]/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div[4]/div/div/div[2]/div/div/div/div/div/div/div[2]/div[2]/span[4]/div/span[2]"));
Console.WriteLine(d.Displayed);

Relevant log output

KO
D 2024-09-26 14:15:53:972 C:\code\selenium\cpp\iedriver\Script.cpp(285) 067C559C
T 2024-09-26 14:15:53:977 C:\code\selenium\cpp\iedriver\IECommandExecutor.cpp(734) Entering IECommandExecutor::OnScriptWait
T 2024-09-26 14:15:53:977 C:\code\selenium\cpp\iedriver\IECommandExecutor.cpp(1315) Entering IECommandExecutor::GetCurrentBrowser
T 2024-09-26 14:15:53:977 C:\code\selenium\cpp\iedriver\IECommandExecutor.cpp(1321) Entering IECommandExecutor::GetManagedBrowser
T 2024-09-26 14:15:53:978 C:\code\selenium\cpp\iedriver\IECommandExecutor.cpp(1210) Entering IECommandExecutor::IsAlertActive
T 2024-09-26 14:15:53:978 C:\code\selenium\cpp\iedriver\Browser.cpp(868) Entering Browser::GetActiveDialogWindowHandle
T 2024-09-26 14:15:53:978 C:\code\selenium\cpp\iedriver\Browser.cpp(315) Entering Browser::GetContentWindowHandle
T 2024-09-26 14:15:53:978 C:\code\selenium\cpp\iedriver\Script.cpp(132) Entering Script::ResultIsString
T 2024-09-26 14:15:53:978 C:\code\selenium\cpp\iedriver\Script.cpp(582) Entering Script::ConvertResultToJsonValue
D 2024-09-26 14:15:53:978 C:\code\selenium\cpp\iedriver\IECommandExecutor.cpp(1227) No alert handle is found
T 2024-09-26 14:15:53:978 C:\code\selenium\cpp\iedriver\IECommandExecutor.cpp(901) Entering IECommandExecutor::ScriptWaitThreadProc
T 2024-09-26 14:15:54:004 C:\code\selenium\cpp\iedriver\IECommandExecutor.cpp(734) Entering IECommandExecutor::OnScriptWait
T 2024-09-26 14:15:54:004 C:\code\selenium\cpp\iedriver\IECommandExecutor.cpp(1315) Entering IECommandExecutor::GetCurrentBrowser
T 2024-09-26 14:15:54:004 C:\code\selenium\cpp\iedriver\IECommandExecutor.cpp(1321) Entering IECommandExecutor::GetManagedBrowser
T 2024-09-26 14:15:54:004 C:\code\selenium\cpp\iedriver\IECommandExecutor.cpp(1210) Entering IECommandExecutor::IsAlertActive
T 2024-09-26 14:15:54:004 C:\code\selenium\cpp\iedriver\Browser.cpp(868) Entering Browser::GetActiveDialogWindowHandle
T 2024-09-26 14:15:54:004 C:\code\selenium\cpp\iedriver\Browser.cpp(315) Entering Browser::GetContentWindowHandle
D 2024-09-26 14:15:54:004 C:\code\selenium\cpp\iedriver\IECommandExecutor.cpp(1227) No alert handle is found
T 2024-09-26 14:15:54:005 C:\code\selenium\cpp\iedriver\AsyncScriptExecutor.cpp(230) Entering AsyncScriptExecutor::OnDetachListener
T 2024-09-26 14:15:54:005 C:\code\selenium\cpp\iedriver\AsyncScriptExecutor.cpp(246) Entering AsyncScriptExecutor::OnGetResult
T 2024-09-26 14:15:54:005 C:\code\selenium\cpp\webdriver-server\response.cc(100) Entering Response::SetErrorResponse
W 2024-09-26 14:15:54:005 C:\code\selenium\cpp\webdriver-server\response.cc(101) Error response has status code 17 and message 'Error from JavaScript: 'HTMLFormElement' is undefined' message
T 2024-09-26 14:15:54:005 C:\code\selenium\cpp\webdriver-server\response.cc(94) Entering Response::SetErrorResponse
T 2024-09-26 14:15:54:005 C:\code\selenium\cpp\webdriver-server\response.cc(87) Entering Response::SetResponse
T 2024-09-26 14:15:54:005 C:\code\selenium\cpp\iedriver\AsyncScriptExecutor.cpp(88) Entering AsyncScriptExecutor::OnClose
T 2024-09-26 14:15:54:005 C:\code\selenium\cpp\iedriver\AsyncScriptExecutor.cpp(97) Entering AsyncAtomExecutor::OnDestroy
T 2024-09-26 14:15:54:005 C:\code\selenium\cpp\webdriver-server\response.cc(60) Entering Response::Serialize
T 2024-09-26 14:15:54:020 C:\code\selenium\cpp\iedriver\IESession.cpp(235) Found non-zero response length
T 2024-09-26 14:15:54:020 C:\code\selenium\cpp\iedriver\IECommandExecutor.cpp(201) Entering IECommandExecutor::OnGetResponse
T 2024-09-26 14:15:54:020 C:\code\selenium\cpp\iedriver\IECommandExecutor.cpp(641) Entering IECommandExecutor::OnIsSessionValid
D 2024-09-26 14:15:54:020 C:\code\selenium\cpp\webdriver-server\server.cc(426) Response: {
	"value" : 
	{
		"error" : "javascript error",
		"message" : "Error from JavaScript: 'HTMLFormElement' is undefined",
		"stacktrace" : ""
	}

Operating System

Windows10

Selenium version

4.25 in c# net8.0

What are the browser(s) and version(s) where you see this issue?

EDGE in ieMode

What are the browser driver(s) and version(s) where you see this issue?

IEDriverServer.exe 4.14.0.0 (32-bit), Microsoft Edge WebDriver 129.0.2792.52

Are you using Selenium Grid?

No response

Copy link

@mannaci, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

@mannaci
Copy link
Author

mannaci commented Oct 8, 2024

hi, is there an update?

@shbenzer
Copy link
Contributor

shbenzer commented Oct 14, 2024

Unfortunately, as of June 2022 Selenium no longer supports Internet Explorer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants