Selenium 安装和测试
来源:互联网 发布:moe破解软件下载 编辑:程序博客网 时间:2024/06/04 19:09
>>>pip install -Uselenium
- 对于Chrome,
1)下载Chrome drive:(是个独立的exe)
https://sites.google.com/a/chromium.org/chromedriver/home
参考文档做设置:
https://sites.google.com/a/chromium.org/chromedriver/getting-started
测试代码:
fromselenium import webdriver
fromselenium.common.exceptions import NoSuchElementException
fromselenium.webdriver.common.keys import Keys
importtime
browser =webdriver.Chrome('C:/Program Files (x86)/chromedriver.exe') # Optional argument, if not specified willsearch path.
browser.get("http://www.yahoo.com")# Load page
assert"Yahoo!" in browser.title
elem =browser.find_element_by_name("p1") # Find the query box
elem.send_keys("seleniumhq"+ Keys.RETURN)
time.sleep(0.2)# Let the page load, will be added to the API
try:
browser.find_element_by_xpath("//a[contains(@href,'http://seleniumhq.org')]")
exceptNoSuchElementException:
assert 0, "can't find seleniumhq"
browser.close()
- Selenium 安装和测试
- win7下安装chromedriver和selenium测试
- 为采集动态网页安装和测试Python Selenium库
- 【自动化测试】Selenium自动化测试-环境安装
- 测试工具Selenium和TestNG
- 安装Selenium和安装PhantomJS
- 【selenium学习笔记】selenium自动化测试环境安装
- PyCharm安装selenium模块实现selenium自动化测试
- ubuntu下安装Selenium测试工具
- Firefox安装selenium自动化测试教程
- 自动化测试—Selenium IDE环境安装
- selenium自动化测试☞day1 基础环境安装和简单的demo1
- Selenium IDE简介和安装
- selenium安装和chromedriver配置
- Python3安装PhantomJS和Selenium
- maven2和selenium进行集成测试
- 使用 PHPUnit 和 Selenium 进行测试
- Selenium RC工作原理和测试案例
- 设置Webstorm 利用babel将ES6自动转码成ES5
- 【Web基础】HTTP长连接和短连接以及推送技术原理
- Servlet的生命周期
- SpringMVC的第一个项目创建步骤
- iOS开发
- Selenium 安装和测试
- Python基础总结
- SVN服务器搭建和使用(一)
- 【推荐】你必须知道的EF知识和经验
- num_rows和count(*)的值为何不同?
- socket C/C++编程(10)linux server端面向对象化处理
- HDU 6133 Army Formations (树状数组, 2017 Multi-Univ Training Contest 8)
- 2181: GJJ的日常之暴富梦(数学)
- MySQL存储引擎--MyISAM与InnoDB区别