TA的每日心情 | 无聊 4 天前 |
---|
签到天数: 530 天 连续签到: 2 天 [LV.9]测试副司令
|
1测试积点
报错如下:
- Message: chrome not reachable
- (Driver info: chromedriver=2.38.552522 (437e6fbedfa8762dec75e2c5b3ddb86763dc9dcb),platform=Windows NT 10.0.18363 x86_64)
复制代码 代码如下:
- def startBrowser(name):
- try:
- if name == "sogou":
- # 给Chrome一个二进制
- options = webdriver.ChromeOptions() # 启动参数
- options.binary_location = SogouBrowser_location
- chrome_driver_binary = SogouBrowser_path
- print("start browser name :sogou")
- driver = webdriver.Chrome(executable_path=chrome_driver_binary, options=options)
- return driver
- else:
- print("Not found this browser,You can use 'firefox', 'chrome', 'ie' or 'phantomjs'")
- except Exception as msg:
- print("启动浏览器出现异常:%s" % str(msg))
- @threads(5)
- def run_case(name):
- driver = startBrowser(name)
- driver.get(open_url)
- time.sleep(3)
- print(driver.title)
- driver.quit()
- if __name__ == "__main__":
- names = ["sogou"]
- for i in names:
- run_case(i)
复制代码
|
|