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]: Something wrong when i switch browser tabs with Edge in IE-mode on windows 10. #123

Open
zhuyuemings opened this issue Oct 20, 2023 · 1 comment
Labels
ie Internet Explorer Mode

Comments

@zhuyuemings
Copy link

What happened?

I use selenium-java 4.14.1 and 32 bit Windows IE Driver: IEDriverServer_Win32_4.14.0.zip

<dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-java</artifactId>
    <version>4.14.1</version>
</dependency>

I created 2 Tabs with Edge in IE-mode: Tab1, Tab2

when i opened Tab2, and tried to switch to Tab1

driver.get("https://www.baidu.com");
String windowId = driver.getWindowHandle();
driver.switchTo().newWindow(WindowType.TAB);
driver.get("https://lizhi.shop");
driver.switchTo().window(windowId);
String title = driver.getTitle();
i got the title from Tab1, but the browser is still displays Tab2.

and i can not find any wrong in driver log.

How can we reproduce the issue?

this problem 100% occurrence on windows 10 64 bit (22H2), IE 11, any Edge Version(I tried 102-118),
java 11, source code :

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WindowType;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.ie.InternetExplorerDriverLogLevel;
import org.openqa.selenium.ie.InternetExplorerDriverService;
import org.openqa.selenium.ie.InternetExplorerOptions;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;

public class IESwitchTabTest {

    public static void main(String[] args) {
        String driverLocation = "C:\\work\\driver\\ie\\IEDriverServer.exe";
        String driverLogPath = "C:\\work\\test-out\\driver.txt";
        InternetExplorerOptions options = new InternetExplorerOptions();
        options.attachToEdgeChrome();
        options.introduceFlakinessByIgnoringSecurityDomains();
        System.setProperty("webdriver.ie.driver", driverLocation);
        InternetExplorerDriverService service = new InternetExplorerDriverService.Builder()
                .withLogLevel(InternetExplorerDriverLogLevel.DEBUG).build();
        try {
            service.sendOutputTo(new FileOutputStream(driverLogPath, true));
        } catch (FileNotFoundException e) {
            e.printStackTrace();
            return;
        }
        WebDriver driver = new InternetExplorerDriver(service, options);
        driver.get("https://www.baidu.com");
        String windowId = driver.getWindowHandle();
        driver.switchTo().newWindow(WindowType.TAB);
        driver.get("https://lizhi.shop");
        driver.switchTo().window(windowId);
        String title = driver.getTitle();
        System.out.println(title);
    }

}
@zhuyuemings
Copy link
Author

trace log here:
driver.txt

@bwalderman bwalderman added the ie Internet Explorer Mode label Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ie Internet Explorer Mode
Projects
None yet
Development

No branches or pull requests

2 participants