当前位置:网站首页>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
边栏推荐
- Click cesium to obtain three-dimensional coordinates (longitude, latitude and elevation)
- Apifix installation
- CKA certification notes - CKA certification experience post
- GPS坐标转百度地图坐标的方法
- 伯努利分布,二项分布和泊松分布以及最大似然之间的关系(未完成)
- Simple solution of small up main lottery in station B
- 23 design models
- 理解 YOLOV1 第一篇 预测阶段
- Simple handwritten ORM framework
- Oauth2.0 - explanation of simplified mode, password mode and client mode
猜你喜欢

使用 Abp.Zero 搭建第三方登录模块(一):原理篇

Une exploration intéressante de l'interaction souris - pointeur

理解 期望(均值/估计值)和方差

Zhiniu stock -- 03

智牛股项目--04

Maximum likelihood estimation, divergence, cross entropy

Zhiniu stock project -- 05

深入解析kubernetes controller-runtime

Creating postgre enterprise database by ArcGIS

Understand the first prediction stage of yolov1
随机推荐
理解 期望(均值/估计值)和方差
Detailed explanation of findloadedclass
使用 Abp.Zero 搭建第三方登录模块(一):原理篇
1. Somme des deux nombres
Une exploration intéressante de l'interaction souris - pointeur
Pytorch dataloader implements minibatch (incomplete)
Multithreading and high concurrency (7) -- from reentrantlock to AQS source code (20000 words, one understanding AQS)
Bernoulli distribution, binomial distribution and Poisson distribution, and the relationship between maximum likelihood (incomplete)
Project summary --01 (addition, deletion, modification and query of interfaces; use of multithreading)
有意思的鼠标指针交互探究
[teacher Zhao Yuqiang] Alibaba cloud big data ACP certified Alibaba big data product system
CKA certification notes - CKA certification experience post
Leetcode solution - 01 Two Sum
理解 YOLOV1 第一篇 预测阶段
Oauth2.0 - user defined mode authorization - SMS verification code login
Oauth2.0 - using JWT to replace token and JWT content enhancement
88. 合并两个有序数组
[system design] proximity service
Project summary --2 (basic use of jsup)
It is said that the operation and maintenance of shell scripts are paid tens of thousands of yuan a month!!!