web 自动化测试工具 selenium + python + Chrome
2018-11-19 09:46
375 查看
版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/weixin_43595001/article/details/84204651
1. 下载ChromeDriver 插件 http://chromedriver.storage.googleapis.com/index.html, 下载自己系统对应的版本;
解压后放到Chrome 安装目录;
2. 安装python, 使用pip 安装selenium,(pip install selenium);
3. 使用pycharm 新建 python file;
[code]# coding=utf-8 from selenium import webdriver import time browser = webdriver.Chrome(executable_path='C:\Program Files (x86)\Google\Chrome\Application\chromedriver.exe') browser.get('https://www.baidu.com') input = browser.find_element_by_id('kw')#找到搜索框 input.send_keys('因为爱情')#传送入关键词 time.sleep(3) button = browser.find_element_by_id('su')#找到搜索按钮 button.click() time.sleep(5) browser.close()
4. 运行文件 (python test.py) ;
5.自动运行完成后关闭.
相关文章推荐
- Web自动化测试工具Selenium 1.0正式发布:Chrome支持+用户指南
- Web自动化测试工具Selenium 1.0正式发布:Chrome支持+用户指南
- Web自动化测试工具Selenium 1.0正式发布:Chrome支持+用户指南
- Web自动化测试工具Selenium 1.0正式发布:Chrome支持+用户指南
- Python爬虫工具 Selenium webdriver -自动化测试工具
- python+Selenium2+chrome 构建web自动化
- Selenium(ThoughtWorks公司开发的web自动化测试工具)
- WIN7- selenium-python 自动化测试工具配置环境
- 构建Python+Selenium2自动化测试环境<二>:IE、Chrome和Firefox运行
- selenium——Web自动化测试工具
- 两个WEB自动化测试工具比较 WatiN & Selenium RC
- Selenium基于Python 进行 web 自动化测试
- 构建Python+Selenium2自动化测试环境<二>:IE、Chrome和Firefox运行
- 自动化测试工具 Selenium WebDriver 入门教程
- Python selenium+webdriver 自动化测试例子
- 自动化测试工具 Selenium WebDriver 入门教程
- Python-Selenium2做Web自动化测试(2)-自动化测试常用工具
- selenium web 自动化环境搭建(Windows7 环境, Chrome, Python)
- python下的基于selenium+headless chrome配置及安装,自动化测试登陆界面并截图
- Selenium3与Python3实战Web自动化测试框架