【发布时间】:2015-09-02 07:11:48
【问题描述】:
我想使用Chrome 测试我的网络应用程序(这是强制性的)。
我尝试使用Selenium,但无法在 Chrome 上安装它。
我需要使用脚本(主要是在Python 和JS/Angular)并记录自动测试。
那么如何让Selenium与Chrome合作呢?
【问题讨论】:
-
尝试了您的示例,但没有成功。似乎是我电脑里的东西。尽管来自该地址的脚本当前正在运行并且工作正常。
import time from selenium import webdriver driver = webdriver.Chrome('/path/to/chromedriver') # Optional argument, if not specified will search path. driver.get('http://www.google.com/xhtml'); time.sleep(5) # Let the user actually see something! search_box = driver.find_element_by_name('q') search_box.send_keys('ChromeDriver') search_box.submit() time.sleep(5) # Let the user actually see something! driver.quit()
标签: python angularjs google-chrome selenium qa