设为首页 加入收藏

TOP

Appium1.9 之 Chromedriver安装方式(一)
2018-10-19 15:54:07 】 浏览:82
Tags:Appium1.9 Chromedriver 安装 方式

1、在 appium 官网上下载安装后,下载的是1.7.1的版本,安装之后是1.9.1最新版本。

2、appium安装之后,会发现涉及到 浏览器相关的业务时(我使用的是chrome)会提示 “No Chromedriver found that can automate Chrome '62.0.3202'”。

 1 # -*- coding:utf-8 -*-
 2 '''
 3 Created on Sep 30, 2018
 4 
 5 @author: SaShuangYiBing
 6 
 7 Comment: 
 8 '''
 9 from appium import webdriver
10 desired_caps = {}        
11 desired_caps['platformName'] ='Android'        
12 desired_caps['platformVersion'] ='7.0'       
13 desired_caps['deviceName'] ='DIYTHYTCCQBIV47D'  
14 desired_caps['browserName'] = 'Chrome'     
15   
16 desired_caps["unicodeKeyboard"] ="True"        
17 desired_caps["resetKeyboard"] ="True"        
18 driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
19 
20 
21 print(driver.current_package)
22 print(driver.current_activity)
23 
24 
25 #输出错误如下:
26 Traceback (most recent call last):
27   File "D:\WorkSpace3\EXAMPLE\Appiu_ex\qwsa.py", line 18, in <module>
28     driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
29   File "C:\Program Files\Python36\lib\site-packages\appium\webdriver\webdriver.py", line 97, in __init__
30     super(WebDriver, self).__init__(command_executor, desired_capabilities, browser_profile, proxy, keep_alive)
31   File "C:\Program Files\Python36\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in __init__
32     self.start_session(capabilities, browser_profile)
33   File "C:\Program Files\Python36\lib\site-packages\appium\webdriver\webdriver.py", line 136, in start_session
34     response = self.execute(RemoteCommand.NEW_SESSION, parameters)
35   File "C:\Program Files\Python36\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
36     self.error_handler.check_response(response)
37   File "C:\Program Files\Python36\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
38     raise exception_class(message, screen, stacktrace)
39 selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: No Chromedriver found that can automate Chrome '62.0.3202'. See https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/web/chromedriver.md for more details.
View Code

 

3、按照错误提示提供的 github 链接去查看如何安装这个driver,发现使用 npm 命令进行安装。

4、打开命令行窗口,输入npm 提示命令无效,接下来就得要先安装某个软件才能支持这个命令,网上上查找一翻之后是要安装 Node.js,之前老的appium版本(v1.4左右)是会自带这个node.js的,新版本目前未发现。

5、前往 Node.js 官网下载跟系统匹配的版本进行安装,安装时一路点 Next 直到 Finish 即可。

6、重新打开命令窗口,输入 npm -v 会提示出版本号,如果未显示出版本号则可能是安装出问题,请将上面步骤重新跑一遍。 

7、然后查找浏览器的版本号,找到对应的chrmoedriver 版本号,匹配关系如下:

The following is a list of Chromedriver versions and their corresponding minimum Chrome version that is automatable:

Version Minimum Chrome Version Link to Chromedriver
2.42 68.0.3440.0 v2.42 (link)
2.41 67.0.3360.0 v2.41 (link)
2.40 66.0.3359.0 v2.40 (link)
2.39 66.0.3359.0 v2.39 (link)
2.38 65.0.3325.0 v2.38 (link)
2.37 64.0.3282.0 v2.37 (link)
2.36 63.0.3239.0 v2.36 (link)
2.35 62.0.3202.0 v2.35 (link)
2.34 61.0.3163.0 v2.34 (link)
2.33 60.0.3112.0 v2.33 (lin
首页 上一页 1 2 下一页 尾页 1/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇python多线程与GIL(转) 下一篇Python学习笔记-SQLSERVER的大批..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目