When clicked on a button, a new opened but I am unable to perform any operation on this .

How do I get selenium to use the new window?

code:

       System.setProperty("webdriver.gecko.driver","D:\selenium\geckodriver.exe");
        FirefoxDriver driver = new FirefoxDriver();
        driver.get("base url");
        driver.navigate().to("new tab");
        driver.findElement(By.xpath(xpathExpression)).click();//While  on the button new window is opening 
        //code to perform operation on new window
        driver.findElement(By.xpath(xpathExpression)).click();



Source link https://sqa.stackexchange.com/questions/28415/while-clicking--should-go-to-the-new-window

LEAVE A REPLY

Please enter your comment!
Please enter your name here