当前位置:网站首页>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
边栏推荐
- Support vector machine for machine learning
- Leetcode solution - 01 Two Sum
- Skywalking8.7 source code analysis (I): agent startup process, agent configuration loading process, custom class loader agentclassloader, plug-in definition system, plug-in loading
- Mysql database
- There is no one of the necessary magic skills PXE for old drivers to install!!!
- Pytorch dataloader implements minibatch (incomplete)
- Cesium 点击获取模型表面经纬度高程坐标(三维坐标)
- Kubernetes notes (VIII) kubernetes security
- The programmer shell with a monthly salary of more than 10000 becomes a grammar skill for secondary school. Do you often use it!!!
- Synthetic keyword and NBAC mechanism
猜你喜欢

Kubernetes notes (10) kubernetes Monitoring & debugging

Interesting research on mouse pointer interaction

Bio, NiO, AIO details

Clickhouse learning notes (2): execution plan, table creation optimization, syntax optimization rules, query optimization, data consistency

Core principles and source code analysis of disruptor

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

智牛股--03

Creating postgre enterprise database by ArcGIS

Kubesphere - set up redis cluster

Fluentd facile à utiliser avec le marché des plug - ins rainbond pour une collecte de journaux plus rapide
随机推荐
Project summary --2 (basic use of jsup)
MySQL帶二進制的庫錶導出導入
There is no one of the necessary magic skills PXE for old drivers to install!!!
Kubesphere - build Nacos cluster
輕松上手Fluentd,結合 Rainbond 插件市場,日志收集更快捷
ODL framework project construction trial -demo
Skywalking8.7 source code analysis (I): agent startup process, agent configuration loading process, custom class loader agentclassloader, plug-in definition system, plug-in loading
CKA certification notes - CKA certification experience post
Jedis source code analysis (I): jedis introduction, jedis module source code analysis
深度学习,从一维特性输入到多维特征输入引发的思考
[video of Teacher Zhao Yuqiang's speech on wot] redis high performance cache and persistence
Oauth2.0 - use database to store client information and authorization code
Convolution operation in convolution neural network CNN
Openresty best practices
轻松上手Fluentd,结合 Rainbond 插件市场,日志收集更快捷
Detailed explanation of contextclassloader
Leetcode solution - 01 Two Sum
代码管理工具
项目总结--2(Jsoup的基本使用)
Redis cluster creation, capacity expansion and capacity reduction