Inactive tab is activated when switching to it

Confirmed Issue #8074852 • Assigned to Clay M.

Details

Author
Truong P.
Created
Jul 4, 2016
Privacy
This issue is public.
Reports
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

    public static void main(String args[]) {

        System.setProperty("webdriver.edge.driver", "MicrosoftWebDriver.exe");
        WebDriver driver = new EdgeDriver();
        driver.manage().timeouts().pageLoadTimeout(100, TimeUnit.SECONDS);
        driver.get("http://www.w3schools.com/");
        driver.findElement(By.xpath("//a[text()='Try it Yourself']")).click();
                    
        //Switch to inactive tab. This tab is activated.
        driver.switchTo().window("1");
    }

Expected result: Inactive tab isn’t activated after switching to it. This issue doesn’t occur on Chrome.

Windows Insider Build 14372
EdgeDriver 14366

Attachments

1 attachment

Comments and activity

  • Microsoft Edge Team

    Changed Assigned To to “Ibrahim O.”

  • Thank you for your feedback. Could you please let us know what do you mean by inactive and active tabs and the issue is using tab ID’s instead of window handles ?For the sample you have provided I see that a new tab is being created and switched back to the first tab. After that I can successfully interact with the first tab through the Webdriver as well, such as using click() method again. Please let me know what if I am missing something in here.

    Also I am getting “No such window” error with Chrome. Please also let us know if you receive any error message with MS Webdriver.

    All the best,
    The MS Edge Team

  • Hi Ibrahim,

    It means that after switching to the first tab, it should being activated?
    For the sample that i have provided, it only works with Edge browser so you will get the “No such window” error with Chrome. I’m sorry for my mistake when providing the sample. Could you please re-try with sample as following

    public static void main(String args[]) {
    
            System.setProperty("webdriver.edge.driver", "MicrosoftWebDriver.exe");
            WebDriver driver = new EdgeDriver();
            driver.manage().timeouts().pageLoadTimeout(100, TimeUnit.SECONDS);
            driver.get("http://www.w3schools.com/");
            driver.findElement(By.xpath("//a[text()='Try it Yourself']")).click();
                        
            //The first tab is activated after running the line code
            driver.switchTo().window(driver.getWindowHandles().toArray()[0].toString());
        }
    
  • I have attached a sample, could you please run the JAR file and see if you can still repro. Before run the JAR file make sure you have webdriver executable is running. To do so, I would suggest you to visit this link https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/  and download the insider version from download section. Please let me know your test result. 

    All the best,
    The MS Edge Team

  • I have run your sample with Edge Webdriver 14366. There is a result.

    Run with Edge

    1. Edge browser is started and Tab 1 is activated
    2. Tab 2 is opened and activated
    3. Tab 1 is activated
    4. Tab 3 is opened and activated

    Run with Chrome

    1. Chrome browser is started and Tab 1 is activated
    2. Tab 2 is opened and activated
    3. Tab 3 is opened and activated

    Best regards,
    Truong

  • Thank you for the update. So the only difference I see, MS Webdriver is displaying the active tab unlike Chrome driver. Is that the issue you are referring to?

  • Hi Ibrahim,

    Yes, it is. The expected result is same Chrome driver. Please help fix issue at your earliest convenience. Thank you for your support.

  • Hi Ibrahim,

    Could you give me your Skype? I will use it in our communication.

    Thanks,
    Truong

  • I have escalated the issue for further review and we will keep you posted as soon as we have a resolution. In the meantime we can use this channel for communication or you can email me with that following address. (v-ibora@microsoft.com)

    All the best,
    The MS Edge Team 

  • Microsoft Edge Team

    Changed Assigned To to “Mara P.”

    Changed Assigned To from “Mara P.” to “Ben B.”

    Changed Status to “Confirmed”

    Changed Title from “Inactive tab is activated when switching to it” to “Inactive tab is activated when switching to it”

    Changed Assigned To from “Ben B.” to “Clay M.”

You need to sign in to your Microsoft account to add a comment.

Sign in