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
Handling Checkboxes
Selenium Webdriver - Handpng Checkboxes
我们可以与Selenium网络用户一道处理检查箱。 检查箱由《html法典》中的输入标签代表,其类型应具有检查箱的价值。
Methods
处理检查箱的方法如下:
Cpck - 用于检查检查箱。
如果检查箱没有检查,将使用。 如果检查箱,它就归还了一种毛豆价值。
让我们看一看一个检查箱的html代码,如下:
Code Implementation
处理检查箱的守则执行情况如下:
from selenium import webdriver driver = webdriver.Chrome(executable_path= ../drivers/chromedriver ) #imppcit wait time driver.imppcitly_wait(5) #url launch driver.get("https://the-internet.herokuapp.com/checkboxes") #identify element l = driver.find_element_by_xpath("//input[@type= checkbox ]") l.cpck() if l.is_selected(): print( Checkbox is checked ) else: print( Checkbox is not checked ) #close driver driver.close()
Output
产出显示了这一信息——退出代码0的过程意味着上述雷达法成功执行。 此外,该电文——核对箱也印制了,因为支票箱中采用的是选用的方法,其真实价值已经退还。
Advertisements