当前位置:网站首页>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 selenium
2. install Pytest
pip install -U pytest
3. 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
边栏推荐
- Advanced technology management - do you know the whole picture of growth?
- Simple solution of small up main lottery in station B
- [teacher Zhao Yuqiang] use the catalog database of Oracle
- It is said that the operation and maintenance of shell scripts are paid tens of thousands of yuan a month!!!
- Zhiniu stock project -- 04
- Clickhouse learning notes (2): execution plan, table creation optimization, syntax optimization rules, query optimization, data consistency
- Maximum likelihood estimation, divergence, cross entropy
- Kubernetes cluster environment construction & Deployment dashboard
- Synthetic keyword and NBAC mechanism
- Convolution operation in convolution neural network CNN
猜你喜欢
从小数据量分库分表 MySQL 合并迁移数据到 TiDB
Use abp Zero builds a third-party login module (I): Principles
.NET程序配置文件操作(ini,cfg,config)
Multithreading and high concurrency (7) -- from reentrantlock to AQS source code (20000 words, one understanding AQS)
Simple solution of small up main lottery in station B
Mysql
JDBC connection database steps
In depth analysis of kubernetes controller runtime
pytorch 搭建神经网络最简版
[teacher Zhao Yuqiang] Alibaba cloud big data ACP certified Alibaba big data product system
随机推荐
Jackson: what if there is a lack of property- Jackson: What happens if a property is missing?
Detailed explanation of findloadedclass
项目总结--2(Jsoup的基本使用)
Leetcode solution - 01 Two Sum
JMeter performance automation test
SVN分支管理
Clickhouse learning notes (I): Clickhouse installation, data type, table engine, SQL operation
轻松上手Fluentd,结合 Rainbond 插件市场,日志收集更快捷
Synthetic keyword and NBAC mechanism
Solve the 1251 client does not support authentication protocol error of Navicat for MySQL connection MySQL 8.0.11
Decision tree of machine learning
1. Sum of two numbers
Simple handwritten ORM framework
Support vector machine for machine learning
Une exploration intéressante de l'interaction souris - pointeur
phpstudy设置项目可以由局域网的其他电脑可以访问
Sorry, this user does not exist!
Yum is too slow to bear? That's because you didn't do it
Project summary --2 (basic use of jsup)
[Zhao Yuqiang] deploy kubernetes cluster with binary package