-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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]: Tab cannot be switched in IE compatibility mode of edge. #10701
Comments
@accamo, thank you for creating this issue. We will troubleshoot it as soon as we can. Info for maintainersTriage this issue by using labels.
If information is missing, add a helpful comment and then
If the issue is a question, add the
If the issue is valid but there is no time to troubleshoot it, consider adding the
If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C),
add the applicable
After troubleshooting the issue, please add the Thank you! |
I think this is a duplicate of #8868 |
@titusfortner Thank you! just in case, my driver configuration: driver = {
System.setProperty("webdriver.ie.driver", "./src/test/resources/driver/IEDriverServer.exe")
InternetExplorerOptions options = new InternetExplorerOptions()
options.requireWindowFocus()
options.attachToEdgeChrome()
options.withEdgeExecutablePath("C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe")
def driver = new InternetExplorerDriver(options)
driver.manage().window().maximize()
driver} |
If the issue is different, then we need more information, please see below. |
Hi, @accamo. Either a complete code snippet and URL/HTML (if more than one file is needed, provide a GitHub repo and instructions to run the code), the specific versions used, or a more detailed description to help us understand the issue. Note: If you cannot share your code and URL/HTML, any complete code snippet and URL/HTML that reproduces the issue is good enough. Reply to this issue when all information is provided, thank you. |
Please try with latest IE Driver v4.2 |
@diemol |
@titusfortner |
Without a way to reproduce it we cannot tell if it is a Selenium issue or an issue in the IE mode of Edge. It does not need to be the same code you use internally, but something we can use to reproduce the issue. |
I am not able to test it on 4.2.0 because webdriver is stuck on the initial page and doesn't do anything... Try this to reproduce (Nuget versions: 4.0.0, IEDriverServer version: 4.0.0) C#var service = InternetExplorerDriverService.CreateDefaultService(DRIVER_DIRECTORY, DRIVER_NAME);
var ieOptions = new InternetExplorerOptions()
{
PageLoadStrategy = PageLoadStrategy.None,
Proxy = null,
AttachToEdgeChrome = true,
EdgeExecutablePath = @"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" //Default installation path...
};
var webDriver = new InternetExplorerDriver(service, ieOptions);
webDriver.Navigate().GoToUrl("http://bing.com");
var firstHandler = webDriver.CurrentWindowHandle;
webDriver.SwitchTo().NewWindow(WindowType.Tab);
webDriver.Navigate().GoToUrl("http://google.com");
webDriver.SwitchTo().Window(firstHandler);
//Automation on first page
var searchTextBox = webDriver.FindElement(By.Id("sb_form_q"));
var searchButton = webDriver.FindElement(By.Id("search_icon"));
searchTextBox.SendKeys("Test");
searchButton.Click(); Demo: |
We can't do anything about 4.0, we can only fix problems in 4.2, so let's figure out why you can't get 4.2 working. What error do you get? What code are you using to start it? |
Тhe same code as shown above! but with updated NuGet "WebDriver" and IEDriverServer.exe (both 4.2.0) |
Can you please try what the Edge team suggests when opening new windows and then report back? |
The issue is not in opening a new tab, the issue is in switching between opened tabs! |
@diemol, @titusfortner is there any update on this? |
I was troubleshooting this on my Windows machine and I was able to reproduce it. Somehow IEDriver does not switch back to the initial window handle. Here is the code I was using, also following the recommendation from the docs in Edge. static void Main(string[] args)
{
var ieOptions = new InternetExplorerOptions()
{
PageLoadStrategy = PageLoadStrategy.None,
Proxy = null,
AttachToEdgeChrome = true,
EdgeExecutablePath = @"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe"
};
var webDriver = new InternetExplorerDriver(ieOptions);
webDriver.Navigate().GoToUrl("http://bing.com");
var firstHandler = webDriver.CurrentWindowHandle;
webDriver.SwitchTo().NewWindow(WindowType.Tab);
webDriver.Navigate().GoToUrl("http://google.com");
webDriver.SwitchTo().Window(firstHandler); // Does not go to the initial window handle.
Console.WriteLine(webDriver.WindowHandles.Count);
webDriver.SwitchTo().Window(firstHandler);
var newWindowHandle = webDriver.CurrentWindowHandle;
Console.WriteLine("First handle: " + firstHandler);
foreach (string window in webDriver.WindowHandles)
{
Console.WriteLine("Handle: " + window);
if(newWindowHandle != window)
{
webDriver.SwitchTo().Window(window);
break;
}
}
Thread.Sleep(5000);
//Automation on first page
//var searchTextBox = webDriver.FindElement(By.Id("sb_form_q"));
//var searchButton = webDriver.FindElement(By.Id("search_icon"));
//searchTextBox.SendKeys("Test");
//searchButton.Click();
webDriver.Quit();
} There is not much we can do at the Selenium project since the Edge folks are the ones who are kindly helping to maintain the IEDriver. Please report this issue to their team. I will leave the links to report it below. |
Hi, @accamo. You can see if the feature is passing in the Web Platform Tests. If it is something new, please create an Issue with the MSEdgeDriver team. Feel free to comment the issues that you raise back in this issue. Thank you. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
What happened?
When I try to switch tab with driver.switchTo().window() at IE compatibility mode of edge,it doesn't work.
It worked using chrome and edge.
Detail
Currently, we are testing an application that requires tab switching using Edge IE mode.
Using driver.switchTo().window() code only changes the focus of the program.
During runtime, we observed that the above code does not change the focus of the screen.
We have come up to the solution of using driver.switchTo().window() and send key (CTRL + Tab) to switch both program and screen focus. However, since send keys are unstable (not returning any indication whether it successfully switched tab or not), we would like to know is it possible to have the driver.switchTo().window() code support both program and screen focus switch for Edge IE mode? Is it expected that driver.switchTo().window() only supports program focus?
Regarding tab and window, are there assurances that there is no difference in terms of data, function and control between window and tab?
Relevant log output
Operating System
Windows 10
Selenium version
selenium 4.1.2, java 11
What are the browser(s) and version(s) where you see this issue?
edge 101.0.1210.53
What are the browser driver(s) and version(s) where you see this issue?
IEDriverServer 4.0.0
Are you using Selenium Grid?
No response
The text was updated successfully, but these errors were encountered: