打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
selenium2 navigate()

Navigation: History and Location

Earlier, we covered navigating to a page using the “get” command( driver.get("http://www.example.com")) As you’veseen, WebDriver has a number of smaller, task-focused interfaces,and navigation is a useful task. Because loading a page is such afundamental requirement, the method to do this lives on the mainWebDriver interface, but it’s simply a synonym to:

driver.navigate().to("http://www.example.com");

To reiterate: “navigate().to()” and “get()” do exactlythe same thing. One’s just a lot easier to type than the other!

The “navigate” interface also exposes the ability to movebackwards and forwards in your browser’s history:

driver.navigate().forward();driver.navigate().back();

Please be aware that this functionality depends entirely on theunderlying browser. It’s just possible that something unexpectedmay happen when you call these methods if you’re used to thebehaviour of one browser over another.

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
Selenium-Webdriver系列教程(二)————浏览器的简单操作
网页内容获取
Nan Han's Realty ONE Group
iup.webbrowser Lua
CDHtmlDialog 如何捕获网页打开失败的消息
Intellij-IDEA2016_Opeation
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服