当前位置:网站首页>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()
边栏推荐
- 想要做好软件测试,可以先了解AST、SCA和渗透测试
- R language Visual scatter diagram, geom using ggrep package_ text_ The rep function avoids overlapping labels between data points (set the min.segment.length parameter to inf and do not add label segm
- logstash
- 启牛开的证券账户安全吗?是怎么开账户的
- Interviewer: "classmate, have you ever done a real landing project?"
- Feign use
- 阿里云技术专家秦隆:可靠性保障必备——云上如何进行混沌工程?
- Want to go whoring in vain, right? Enough for you this time!
- 【3】 DEM mountain shadow effect
- 【ROS进阶篇】第九讲 URDF的编程优化Xacro使用
猜你喜欢
![[shutter -- layout] stacked layout (stack and positioned)](/img/01/c588f75313580063cf32cc01677600.jpg)
[shutter -- layout] stacked layout (stack and positioned)
![[rust] reference and borrowing, string slice type (& STR) - rust language foundation 12](/img/48/7a1777b735312f29d3a4016a14598c.png)
[rust] reference and borrowing, string slice type (& STR) - rust language foundation 12

LeetCode 1184. 公交站间的距离

Eureka usage record
![[ROS advanced chapter] Lecture 9 programming optimization of URDF and use of xacro](/img/a2/9b676d0f1b33cc7d413cee6c52d76d.png)
[ROS advanced chapter] Lecture 9 programming optimization of URDF and use of xacro

PyTorch可视化
What does the software testing process include? What are the test methods?

PyTorch项目实战—FashionMNIST时装分类

WPF project introduction 1 - Design and development of simple login page

基于Caffe ResNet-50网络实现图片分类(仅推理)的实验复现
随机推荐
If you want to do a good job in software testing, you can first understand ast, SCA and penetration testing
Create directories and subdirectories circularly
基于Caffe ResNet-50网络实现图片分类(仅推理)的实验复现
Pytorch main module
2.1.2 application of machine learning
【2】 Grid data display stretch ribbon (take DEM data as an example)
Want to go whoring in vain, right? Enough for you this time!
Eureka registration center opens password authentication - record
Software testing interview question: Please list the testing methods of several items?
MySQL练习二
如何从远程访问 DMS数据库?IP地址是啥?用户名是啥?
艰辛的旅程
What is ci/cd?
2.1.2 机器学习的应用
PyTorch项目实战—FashionMNIST时装分类
More accurate and efficient segmentation of organs-at-risk in radiotherapy with Convolutional Neural
SSTI 模板注入漏洞总结之[BJDCTF2020]Cookie is so stable
【九】坐标格网添加以及调整
Cmake learning notes (II) generation and use of Library
LeetCode 0133. 克隆图