课程: Test Automation with Selenium WebDriver for Java
免费学习该课程!
今天就开通帐号,24,700 门业界名师课程任您挑!
Navigation
- Browsers have built-in capabilities that allow you to navigate through web pages. For example, after navigating to other pages, we can use these arrows to go back and forward. There's also a button to refresh. With Selenium WebDriver, we can accomplish these same browser actions even though those buttons aren't represented in the DOM of the page. Let's see how. The code we have here goes to the clicks page and clicks a link to bring us to a new page. Now we'll go to the previous page by saying driver.navigate().back(); and we'll print out where we are now, so let's do a print statement and say we went back. We're now on page, and we can add the title of the page here, so driver.getTitle(); Now we'll go forward by saying driver.navigate().forward(); and we'll also print where we are now, "went forward. on page: " and we'll add the title again. Great. Now let's run this. Awesome. We see that we started on the clicks page. We clicked the link, which brought us to the XHTML test page…
内容
-
-
-
-
-
-
-
-
(已锁定)
Browser information1 分钟 17 秒
-
(已锁定)
Navigation1 分钟 44 秒
-
(已锁定)
Tabs3 分钟 24 秒
-
(已锁定)
Modals2 分钟 21 秒
-
(已锁定)
Alerts4 分钟 8 秒
-
(已锁定)
iFrames2 分钟 3 秒
-
(已锁定)
Cookies3 分钟 6 秒
-
(已锁定)
Taking screenshots7 分钟 35 秒
-
(已锁定)
Code Challenge: Accept alert in new tab37 秒
-
(已锁定)
Solution: Accept alert in new tab39 秒
-
(已锁定)
-
-
-