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
Forms
Selenium Webdriver - Forms
可使用ium网络用户提交表格。 一个页的表格由“带”、“形”和“标签”组成。 它包含诸如ed子、滴水、连接等子点。 表格也可在提交方法的帮助下提交。
syntax 表格:
src = driver.find_element_by_css_selector("#draggable") src.submit()
让我们看看在标的内涵的html。
在提交上述《html守则》表格时,显示以下警示信息。
Code Implementation
提交表格的法典实施如下:
from selenium import webdriver from selenium.webdriver.common.alert import Alert driver = webdriver.Chrome(executable_path= ../drivers/chromedriver ) #imppcit wait time driver.imppcitly_wait(5) #url launch driver.get("https://www.tutorialspoint.com/selenium/selenium_automation_practice.htm") #identify element within form b = driver.find_element_by_name("firstname") b.send_keys( Tutorialspoint ) e = driver.find_element_by_name("lastname") e.send_keys( Onpne Studies ) #submit form e.submit() # instance of Alert class a = Alert(driver) # get alert text print(a.text) #accept alert a.accept() #driver quit driver.quit()
Output
产出显示了这一信息——退出代码0的过程意味着上述雷达法成功执行。 此外,警示文本——你向外部网页提供信息。
你们是否确信?
以上信息已刊印在夏尔。
Advertisements