当前位置:网站首页>Selenium ide installation recording and local project maintenance
Selenium ide installation recording and local project maintenance
2022-07-03 06:12:00 【Liyuan Dong】
If you are interested in python Grammar or script maintenance is hard , Take a look at the following article
It also supports other automated language grammars
One 、Selenium IDE Install recording
# Prerequisite
- Firefox : As the browser used
- Selenium IDE: start-up Selenium IDE, Select Add , You will find the icon under the toolbar
- Python: Choose Custom installation , Be sure to check Add python 3.8/3.9 to PATH
- Visual Studio Code: As a development tool

# Quick start
1. start-up Selenium IDE, choice Creat a new project
2. In the test case pane, select “+”, Create test case name

3. Click the start recording button , Enter the URL, For example, the name of our test case is " Test the search function " , We are going to record the first script ,Base URL We choose use Baidu Search , You will know , Enter key "selenium", Click on the search , We just need to click the record button , Then operate the above steps in the browser , After clicking on seleniumIDE Turn off the recording button , Generate the following script .

4. Edit script , Add assertions , Breakpoints or comments , Add assertions , The right choice insert new command, According to need , add to Command、Target、Value.

5. With Command by Verify text example , Input Target、Value、Description, The element position is in CSS Method examples

Two 、Selenium IDE Local engineering maintenance
1. install selenium
pip install selenium2. install Pytest
pip install -U pytest3. download chromedriver.exe Put it in Python The installation path Python39\Scripts Next ,
- Each local machine browser is different , If prompt chromedriver.exe error , Please update the browser driver and browser consistent version
- download browser Chrome Driver, By looking at Chrome Browser version , Select the corresponding version number
- stay windows In the system ,driver It's indistinguishable 32 Bit and 64 Bit , Download win32.zip that will do
4. open VS code engineering , newly build .py file , Paste as follows command,F5 Start debugging
- It will start automatically after successful operation chrome The browser opens a Baidu page
from selenium import webdriver
browser = webdriver.Chrome()
browser.get('http://www.baidu.com/')
5. Use the previous selenium IDE The successfully recorded script is exported to VS code Project folder
- Change Firefox browser startup to chrome Browser driven
# Choose Google browser
self.driver = webdriver.Chrome()
- Add code at the end , preservation ,F5 Start debugging
if __name__=='__main__':
pytest.main()- Debugging is successful, and it starts automatically chrome The browser shows the content of automatic operation
- pytest Module methods can also be replaced unittest Module method implementation

If you feel more than enough, you can read the third article Jmeter Performance automated testing
边栏推荐
- JDBC connection database steps
- Simple solution of small up main lottery in station B
- [teacher Zhao Yuqiang] use Oracle's tracking file
- Code generator - single table query crud - generator
- Solve the problem that Anaconda environment cannot be accessed in PowerShell
- MySQL帶二進制的庫錶導出導入
- [set theory] equivalence relation (concept of equivalence relation | examples of equivalence relation | equivalence relation and closure)
- It is said that the operation and maintenance of shell scripts are paid tens of thousands of yuan a month!!!
- Oauth2.0 - user defined mode authorization - SMS verification code login
- Une exploration intéressante de l'interaction souris - pointeur
猜你喜欢

The most responsible command line beautification tutorial

Loss function in pytorch multi classification

Cesium 点击获取模型表面经纬度高程坐标(三维坐标)

最大似然估计,散度,交叉熵

Analysis of Clickhouse mergetree principle

Understand the first prediction stage of yolov1

Oauth2.0 - Introduction and use and explanation of authorization code mode

Simple handwritten ORM framework

Method of converting GPS coordinates to Baidu map coordinates

Tabbar settings
随机推荐
使用conda创建自己的深度学习环境
1. 两数之和
Une exploration intéressante de l'interaction souris - pointeur
pytorch 搭建神经网络最简版
Zhiniu stock project -- 04
[system design] proximity service
Understand expectations (mean / estimate) and variances
Common interview questions
Kubernetes notes (I) kubernetes cluster architecture
PMP笔记记录
.NET程序配置文件操作(ini,cfg,config)
理解 YOLOV1 第一篇 预测阶段
Cesium Click to obtain the longitude and latitude elevation coordinates (3D coordinates) of the model surface
Kubernetes notes (V) configuration management
Simple understanding of ThreadLocal
Code generator - single table query crud - generator
Leetcode solution - 01 Two Sum
Apple submitted the new MAC model to the regulatory database before the spring conference
Solve the 1251 client does not support authentication protocol error of Navicat for MySQL connection MySQL 8.0.11
In depth analysis of kubernetes controller runtime