Appium [已解决]Appium 更新到 1.1 后运行脚本提示 SDK 没有安装

HellenGo · 2014年06月11日 · 最后由 HellenGo 回复于 2014年06月11日 · 1475 次阅读

运行脚本之后 一直提示这个状态 :test_add_contacts (main.ContactsAndroidTests) ...

手动停止 appium 后,错误提示 log 如下:

eclipse 中报错如下:
WebDriverException: Message: u'A new session could not be created. (Original error: Could not find zipalign; do you have the Android SDK installed and the tools + platform-tools folders added to your PATH?)'

ps:sdk 已经安装,更新到最新了.

共收到 12 条回复 时间 点赞

Traceback (most recent call last):
File "D:\workspace\Traffic\src\AppiumAndroidTest\android_contacts.py", line 23, in setUp
self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
File "C:\Python27\lib\site-packages\appium\webdriver\webdriver.py", line 34, in init
super(WebDriver, self).init(command_executor, desired_capabilities, browser_profile, proxy, keep_alive)
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 73, in init
self.start_session(desired_capabilities, browser_profile)
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 121, in start_session
'desiredCapabilities': desired_capabilities,
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 171, in execute
response = self.command_executor.execute(driver_command, params)
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\remote_connection.py", line 347, in execute
return self._request(command_info[0], url, body=data)
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\remote_connection.py", line 415, in _request
resp = opener.open(request)
File "C:\Python27\lib\urllib2.py", line 391, in open
response = self._open(req, data)
File "C:\Python27\lib\urllib2.py", line 409, in _open
'_open', req)
File "C:\Python27\lib\urllib2.py", line 369, in _call_chain
result = func(*args)
File "C:\Python27\lib\urllib2.py", line 1173, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "C:\Python27\lib\urllib2.py", line 1148, in do_open
raise URLError(err)
URLError:

你的代码那, 用的是 selendroid 还是普通的 android

你需要把 sdk\tools 加到你的 path 变量里面

#4 楼 @seveniruby 我已经加了啊 之前 0.18 的时候是可以运行的

#3 楼 @seveniruby 我用的官网的 contact 例子 用的是普通的安卓

#5 楼 @hellengo 错误里面已经说了, 找不到 zipalign, 这个文件在 sdk 的 tools 目录下, 所以试试从命令行直接运行 zipalign 试试,看看能不能找到

#8 楼 @hellengo 这个说明你的 zipalign 已经配置多了, 是刚配置的吗, 是不是 appium 启动的时候还没有配置导致的.

你现在重新运行下 appium 试试

#9 楼 @seveniruby 可以运行了 多谢思寒.. 怎么控制输入的时候是英文字母 ,现在运行的时候输入是中英文混合的

#10 楼 @hellengo 多注意他的错误提示, 其实里面都已经给出解决办法了. 细心解决就可以搞定的.

#10 楼 @hellengo 中文输入请参考其他的帖子. 自行 google 下

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册