Selenium Webdriver Tutorial
Selected Reading
- Selenium WebDriver - Discussion
- Selenium WebDriver - Useful Resources
- Selenium WebDriver - Quick Guide
- Double Click
- Right Click
- Capture Screenshots
- Scroll Operations
- Chrome WebDriver Options
- JavaScript Executor
- Select Support
- Wait Support
- Headless Execution
- Executing Tests in Multiple Browsers
- Handling Checkboxes
- Read/Write data from Excel
- Generating HTML Test Reports in Python
- Color Support
- Handling Edit Boxes
- Handling Links
- Alerts
- Windows
- Drag and Drop
- Forms
- Create a Basic Test
- Action Class
- Exceptions
- Cookies
- Backward and Forward Navigation
- Pop-ups
- Explicit and Implicit Wait
- Identify Multiple Elements
- Identify Single Element
- Browser Navigation
- Installation
- Introduction
- Home
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Backward and Forward Navigation
Backward and Forward Navigation
在沙伦ium网络繁荣者的帮助下,我们可以在浏览器史上向后前进。 为了在历史上向前迈出一步,使用了前进的方法。 为了扭转历史上倒退的一步,采用了这种方法。
后向和前向导航的速成克如下:
driver.forward() driver.back()
Code Implementation
后向和前向导航的守则实施如下:
from selenium import webdriver driver = webdriver.Chrome(executable_path= ../drivers/chromedriver ) #imppcit wait time driver.imppcitly_wait(0.8) #url 1 launch driver.get("https://www.tutorialspoint.com/about/about_careers.htm") #url 2 launch driver.get("https://www.tutorialspoint.com/onpne_dev_tools.htm") #back in history driver.back() print( Page navigated after back: + driver.title) #forward in history driver.forward() print( Page navigated after forward: + driver.title) #driver quit driver.quit()
Output
产出显示了这一信息——退出代码0的过程意味着上述雷达法成功执行。 两台URLs发射后,网上浏览器在浏览器历史和上页标题(从驾驶人手中获取)中回馈。 标题方法——图西里点的职业——图西里点的印刷版。
网上浏览器在浏览器史上和下一页的标题(从驾驶员手中获取)上也取得了进展。 标题方法——在线开发和测试工具在专册中印刷。
Advertisements