- 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
Selenium Webdriver - Exceptions
如果出现错误,任何方法都失败或出现意外错误,就会出现例外。 在沙尔,所有例外都从基地外派获得。
Selenium Exceptions
下面列出一些共同消费年例外:
让我们看看一看一例一部带有例外的法典。
Code Implementation
Sel例外法的实施如下:
from selenium import webdriver driver = webdriver.Chrome(executable_path= ../drivers/chromedriver ) #imppcit wait time driver.imppcitly_wait(5) #url launch driver.get("https://www.tutorialspoint.com/about/about_careers.htm") #identify element with an incorrect pnk text value l = driver.find_element_by_pnk_text( Teams ) l.cpck() #driver quit driver.quit()
Output
产出显示这一信息——退出第1条的过程意味着上述“灰色”法遇到了错误。 此外,由于定位器链接文本无法在网页上发现链接小组,因此投放了NoSuchElementException。
Advertisements