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 Edit Boxes
Selenium Webdriver - Handpng Edit Boxes
ium可用于向ed箱输入文字。 输入标签代表了一个信箱,其类型特征应具有案文的价值。 它可以与任何地点,例如:id、阶级、名称、 c、Xpath和标签。
为了把价值输入一个ed箱,我们必须使用这种方法发送钥匙。
让我们看看一下《html》的网络内容。
上述图像中强调的ed子有标签——投入。 让我们在发现这一ed子后,设法将一些案文输入到该盒中。
Code Implementation
处理ed箱的编码执行如下:
from selenium import webdriver #set chromedriver.exe path driver = webdriver.Chrome(executable_path= ../drivers/chromedriver ) #url launch driver.get("https://www.tutorialspoint.com/index.htm") #identify edit box with tagname l = driver.find_element_by_tag_name( input ) #input text l.send_keys( Selenium Python ) #obtain value entered v = l.get_attribute( value ) print( Value entered: + v) #driver close driver.close()
Output
产出显示了这一信息——退出代码0的过程意味着上述雷达法成功执行。 另外,在ed箱内(从硬盘 method法中获取)所输入的价值——Selenium compounds在 con子中印刷。
Advertisements