当前位置:网站首页>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
边栏推荐
- There is no one of the necessary magic skills PXE for old drivers to install!!!
- Oauth2.0 - user defined mode authorization - SMS verification code login
- Difference between shortest path and minimum spanning tree
- BeanDefinitionRegistryPostProcessor
- Kubernetes cluster environment construction & Deployment dashboard
- SVN分支管理
- Apifix installation
- 多线程与高并发(7)——从ReentrantLock到AQS源码(两万字大章,一篇理解AQS)
- Kubernetes notes (IV) kubernetes network
- 輕松上手Fluentd,結合 Rainbond 插件市場,日志收集更快捷
猜你喜欢

Kubesphere - Multi tenant management

The most responsible command line beautification tutorial

Project summary --01 (addition, deletion, modification and query of interfaces; use of multithreading)

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

Understand the first prediction stage of yolov1
![[system design] proximity service](/img/4a/2e68536cbe385af1d1a591e674fbf0.png)
[system design] proximity service

Oauth2.0 - using JWT to replace token and JWT content enhancement

深入解析kubernetes controller-runtime
![[teacher Zhao Yuqiang] use Oracle's tracking file](/img/0e/698478876d0dbfb37904d7b9ff9aca.jpg)
[teacher Zhao Yuqiang] use Oracle's tracking file

Kubernetes notes (IX) kubernetes application encapsulation and expansion
随机推荐
tabbar的设置
Detailed explanation of findloadedclass
There is no one of the necessary magic skills PXE for old drivers to install!!!
Characteristics and isolation level of database
Solve the 1251 client does not support authentication protocol error of Navicat for MySQL connection MySQL 8.0.11
代码管理工具
Kubernetes notes (VI) kubernetes storage
项目总结--2(Jsoup的基本使用)
Cesium entity(entities) 实体删除方法
Cesium 点击获取模型表面经纬度高程坐标(三维坐标)
Use abp Zero builds a third-party login module (I): Principles
Skywalking8.7 source code analysis (II): Custom agent, service loading, witness component version identification, transform workflow
Kubesphere - build MySQL master-slave replication structure
CKA certification notes - CKA certification experience post
Apifix installation
Oauth2.0 - using JWT to replace token and JWT content enhancement
Click cesium to obtain three-dimensional coordinates (longitude, latitude and elevation)
Bio, NiO, AIO details
表达式的动态解析和计算,Flee用起来真香
Kubesphere - set up redis cluster