-
Notifications
You must be signed in to change notification settings - Fork 7
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
WebDriver IE Mode hanging on page load #2047 #38
Comments
I guess this isn't actually a EdgeWebDriver issue, either, but presumably a change in Edge browser affecting what IE Driver is doing. Should we track this here or in Selenium? |
Thanks for creating this issue. Tracking it here is the best way to put it on our radar so we can investigate if this is a regression from Edge. Feel free to keep the Selenium issue open and linked to this one. |
Any update on the issue? |
I haven't been able to reproduce this with either Java or C#. I tried navigating to https://selenium.dev with the options above and the navigation completed successfully without hanging the client. |
This is my first attempt using IE Mode with Selenium and had this same issue. Testing with... |
Trace from InternetExplorerDriverService
|
Thanks for sharing the trace logs. I see that the driver is failing to attach to the msedge.exe process that was launched. @jefsmo @titusfortner do you have more details about the repro environment? I'm not able to repro this on any of the machines I've tried. |
@bwalderman Windows on VMWare Client Virtual Machine Microsoft Edge IEDriverServer |
@jefsmo Where did those tracelogs come from? I don't remember seeing them, but they have my username??? Also, they are the wrong tracelogs for this issue. Lines 306 - 316 keep repeating until the timeout happens This is on my Mac with Windows 11 via Parallels. I updated to latest Selenium/IEDriver/Edge versions. |
@titusfortner using OpenQA.Selenium;
using OpenQA.Selenium.IE;
namespace DriverServiceSample
{
static class Program
{
static void Main()
{
// Create the service.
var service = InternetExplorerDriverService.CreateDefaultService(@"C:\WebDrivers", "IEDriverServer.exe");
service.Port = 5555;
service.HideCommandPromptWindow = false;
service.HostName = "localhost";
service.LoggingLevel = InternetExplorerDriverLogLevel.Trace;
service.SuppressInitialDiagnosticInformation = false;
if (!service.IsRunning)
{
service.Start();
}
// Open the browser.
if (service.IsRunning)
{
InternetExplorerOptions options = new()
{
AttachToEdgeChrome = true,
IgnoreZoomLevel = true,
EdgeExecutablePath = "C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe",
BrowserAttachTimeout = TimeSpan.FromSeconds(15),
BrowserVersion = "11"
};
var timeouts = new
{
@implicit = 0,
pageLoad = 30000,
script = 3000
};
options.AddAdditionalOption("timeouts", timeouts);
IWebDriver? driver = default;
try
{
driver = new InternetExplorerDriver(service, options)
{
Url = "https://bing.com"
};
var q = driver.FindElement(By.Id("sb_form_q"));
q.SendKeys("WebDriver");
q.Submit();
}
finally
{
driver?.Quit();
service.Dispose();
}
}
}
}
} |
I am now also stuck on this issue. |
@jefsmo I think your issue is different from the one I submitted here. @sathiyakumars2308 & @sohrabtowfighi are you using Windows with a virtual machine? So far the people I've heard are having this issue are all accessing via Mac, so I'm curious. |
@titusfortner I used a physical machine, not a virtual one. To be honest, I have given up on Selenium for my current task. |
@bwalderman any ideas on what we can do about this one? Someone else posted this issue in Selenium Slack just yesterday. Very weird that it doesn't happen consistently. |
@titusfortner I took a closer look at your trace https://gist.github.com/titusfortner/3aef8609eb6b0bfa052d1d764ce01f8f and I see that there may be an issue navigating across zones:
It does look like protected mode settings are missing for some zones, so they may not all match.
Can you double check the protected mode settings and try your repro again? |
Oh interesting! How do I do this when IE isn't installed? I don't see anything in Edge Options or in Internet Options. |
I followed this guide and it works!! So, uhh, is there a better way to do this than to hack the registry? :-D |
Oh, or people can set ie_options.ignore_protected_mode_settings = True |
That's a good question. I'll follow up with the IE mode owners and see if there's a documentation gap on our side. |
I have been enforcing the protected mode settings for all zones from the 'Internet Options' control panel menu. Just another option. Not necessarily better if you have access to the registry |
@naijabounce I don't see any settings for protected mode on internet options control panel |
I can confirm these are removed from the IE control panel on systems where IE11 has been disabled. That leaves either the registry or group policy for configuring these settings. Both methods are supported, if not necessarily well documented at the moment. |
I started down the group policy path, but could not find the right things to change. I need to change the registry settings back and see if ooc, is there a reason that for Edge mode we *don't automatically set ignore_zoom and ignore_protected_mode? |
@titusfortner sorry I missed the "Windows 11" part |
@naijabounce no worries, I was hoping I'd missed something! :-D |
I've been taking a closer look and ran several hundred test runs on a Win11 physical machine, VM, and on a Mac through Parallels. I haven't seen any stability issues specific to running on a Mac and nothing that matches the log output above where IEDriver fails to find an IE process after launch. I did run into a hang during the Quit command which I was able to resolve with SeleniumHQ/selenium#11079. Before this fix, IEDriver would hang indefinitely waiting for the browser to close, and Selenium would time out on the client side. When my test script attempts to create another session using the same driver service, the session doesn't get created because the IEDriver server still wasn't able to close the previous one. This isn't exactly what's described above, but it might explain some reports in the wild. There is also a known issue that IEDriver sessions will not work if the machine is locked or the user is not logged in if accessing the machine remotely: #15, #27. The next step would be to try and collect some more useful logs. If this issue happens consistently on a particular environment, the user can try running Windows Performance Recorder to collect an ETW trace. After installing, launch Windows Performance Recorder. Under "Scenario Analysis", check "Internet Explorer", and then click "Start" to start tracing. After tracing is stopped, it will be saved to file. That file can be uploaded/shared here and hopefully our team can take a closer look. |
Oh, it's definitely the protected mode issue. Once I set the registry values it works as expected. |
Thanks for confirming. In that case, I'm going to go ahead and close this issue. Please feel free to reopen if this pops up again. |
System
Windows 11 Pro; 10.0.22000 (Parallels)
Edge 103.0.1264.44
Selenium 4.3.0
IE Driver 4.2.0
I'm not getting a response back from the driver when sending to
url
endpoint (e.g.POST session/eb16c8e7-bb37-4eb0-9973-546bc19dc29f/url
)This was reported to Selenium, and according to the user it worked up until Edge 102.0.1245.39 (SeleniumHQ/selenium#10824 (comment)).
I tested in Ruby & Java to make sure it wasn't a Selenium bug:
The text was updated successfully, but these errors were encountered: