Package org.openqa.selenium

Examples of org.openqa.selenium.WebDriver.switchTo()


        // Click on link that will cause popup to be created
        d.findElement(By.xpath("//a")).click();
        // Switch to new popup
        String popupHandle = (String)d.getWindowHandles().toArray()[1];
        d.switchTo().window(popupHandle);

        assertTrue(d.getTitle().contains("Japan"));
    }
}
View Full Code Here


        // Close 1 window and check that 1 is left
        d.close();
        assertEquals(1, d.getWindowHandles().size());

        // Switch to that window
        d.switchTo().window("google");
        assertNotNull(d.getWindowHandle());

        // Close the remaining window and check now there are no windows available
        d.close();
        assertEquals(0, d.getWindowHandles().size());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.