July 2019
Intermediate to advanced
536 pages
12h 57m
English
Let's now see how we can handle switching between the frames of a web page. In the HTML files supplied with this book, you will see a file named Frames.html. If you open that, you will see two HTML files loaded in two different frames. Let's see how we can switch between them and type into the text boxes available in each frame:
public class FrameHandlingTest { WebDriver driver; @BeforeMethod public void setup() throws IOException { System.setProperty("webdriver.chrome.driver", "./src/test/resources/drivers/chromedriver"); driver = new ChromeDriver(); driver.get("http://guidebook.seleniumacademy.com/Frames.html"); } @Test public void switchBetweenFrames() { // First Frame driver.switchTo().frame(0);
Read now
Unlock full access