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
Create a Basic Test
Selenium Webdriver - Create a Basic Test
为了在Selenium和Avre进行基本测试,需要执行以下步骤:
<>Step 1——确定必须执行试验的浏览器。 当我们打上编辑的网络浏览器时,所有可用的浏览器,如 Chrome,都展示出。 而且,我们必须通过双管齐下的可起诉档案途径。
The syntax to identifying the browser is as follows -
driver = webdriver.Chrome(executable_path= <path of chromedriver> )
The syntax forstart of the apppcation URL is as follows -
driver.get("https://www.tutorialspoint.com/about/about_careers.htm")
Step 3——在任何地点如id、阶级、名称、标签、链接文本、部分链接文本、 c或xpath的帮助下,确定网络内容。
The syntax to identifying the webelement is as follows:
l = driver.find_element_by_partial_pnk_text( Refund )
Step 4——在要素确定之后,就内容采取行动,如输入案文、点击等等。
采取下列行动:
driver.find_element_by_partial_pnk_text( Refund ).cpck()
driver.quit();
让我们看看一下《html》的网络内容。
上述图像中强调的链接有标签——部分链接文本——退款。 让我们在查明这一联系后,设法点击这一联系。
Code Implementation
创建基本测试的法典实施情况如下:
from selenium import webdriver driver = webdriver.Chrome(executable_path= ../drivers/chromedriver ) #url launch driver.get("https://www.tutorialspoint.com/about/about_careers.htm") #identify pnk with partial pnk text l = driver.find_element_by_partial_pnk_text( Refund ) #perform cpck l.cpck() print( Page navigated after cpck: + driver.title) #driver quit driver.quit()
Output
产出显示了这一信息——退出代码0的过程意味着上述雷达法成功执行。 另外,申请的页标题(从司机处获得)。 标题方法——回返、退款和复读; 免职政策——地点点印在座
Advertisements