当前位置:网站首页>Selenium use -- installation and testing
Selenium use -- installation and testing
2022-07-25 12:39:00 【Smell and break bamboo】
List of articles
install selenium
In general , Use it directly pip Can be installed
pip install selenium
But if you meet urllib3 Version conflict of , It needs to be solved like this
First uninstall the original selenium and urllib3
pip uninstall selenium
pip uninstall urllib3
Install a specific version of urlib3
pip install urllib3==1.25.11
Install a specific version of selenium
pip install selenium==4.0.0.a1
Configure browser driver
If you want to selenium It can drive the browser into automatic test mode , You need to install the driver of a specific browser
Determine the browser version
Enter in the address field
chrome://version

Get into Taobao mirror Download to drive



Configure boot environment
Decompress the downloaded compressed package , Get one chromedriver.exe Program ( Suppose the file path of the program is :D:\Code\Selenium_Test), You need to configure this path into the environment variable .
test
After configuring the appeal process , You can use the following code to test
from selenium import webdriver
driver = webdriver.Chrome() # Create a Chrome Of driver Instance object
# Access page
driver.get(url="https://www.baidu.com/")
# Search the page id by kw Box of , Input xxx
driver.find_element_by_id("kw").send_keys("xxx")
# Search the page id by su The button , Click
driver.find_element_by_id("su").click()
# sign out
# driver.quit()
边栏推荐
- I want to ask whether DMS has the function of regularly backing up a database?
- Basic concepts of NLP 1
- Plus SBOM: assembly line BOM pbom
- 启牛开的证券账户安全吗?是怎么开账户的
- Deep learning MEMC framing paper list
- Zuul gateway use
- [high concurrency] deeply analyze the execution process of worker threads in the thread pool through the source code
- 【6】 Map box settings
- How to access DMS database remotely? What is the IP address? What is the user name?
- Numpy first acquaintance
猜你喜欢

Leetcode 1184. distance between bus stops

【C语言进阶】动态内存管理

LeetCode 1184. 公交站间的距离

Pytorch advanced training skills

什么是CI/CD?

Zuul gateway use

PyTorch项目实战—FashionMNIST时装分类

Alibaba cloud technology expert Qin long: reliability assurance is a must - how to carry out chaos engineering on the cloud?
![[shutter -- layout] stacked layout (stack and positioned)](/img/01/c588f75313580063cf32cc01677600.jpg)
[shutter -- layout] stacked layout (stack and positioned)

Fiddler packet capturing app
随机推荐
【二】栅格数据显示拉伸色带(以DEM数据为例)
3.2.1 what is machine learning?
3.2.1 什么是机器学习?
2022.07.24(LC_6125_相等行列对)
shell基础知识(退出控制、输入输出等)
Does MySQL have flush privileges
Create directories and subdirectories circularly
我想问DMS有没有定时备份某一个数据库的功能?
Cmake learning notes (II) generation and use of Library
【四】布局视图和布局工具条使用
软件测试面试题目:请你列举几个物品的测试方法怎么说?
JS 将伪数组转换成数组
Excuse me, using data integration to import data from PostgreSQL to MySQL database, emoj appears in some data fields
MySQL implements inserting data from one table into another table
Visualize the training process using tensorboard
Eureka registration center opens password authentication - record
PyTorch的生态简介
1.1.1 欢迎来到机器学习
【5】 Page and print settings
If you want to do a good job in software testing, you can first understand ast, SCA and penetration testing