前端自动化测试selenium

一:环境配置
python 官网下载,安装方法https://blog.csdn.net/qq_34514415/article/details/80201543
selenium3 下载地址 https://pypi.org/project/selenium/#files
HTMLTestRunner 地址 http://tungwaiyip.info/software/HTMLTestRunner.html
安装 https://www.cnblogs.com/feiquan/p/8525903.html
1》解压 --》2:cmd环境进入到setup.py文件所在目录 --》3:python setup.py install命令进行安装 --》4:安装完后用pip list可看到selenium的信息

3and4.png

ChromeDriver 下载地址 http://npm.taobao.org/mirrors/chromedriver 下载和本地chrome相同版本(chrome://settings/help
将chromedriver所在目录配置在path中后
chromedriver.png

二:语法测试
1》cmd中进入python环境 --》 将引入selenium给webdriver --> web = webdriver.Chrome() --> 打开chrome浏览器


test.png

打开后,测试成功!环境没毛病了

三:写自动化测试脚本


test02.png

搭配python的自动化测试框架unittest

test03.png
test04.png
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容