Appium [在线等]使用 appium 自动化测试,运行 python 脚本时,总提示错误 WebDriverException: Message: An unknown server-side error occurred while processing the command

chocolatesweety · 2015年08月07日 · 最后由 enumerate 回复于 2016年02月24日 · 1264 次阅读

附上旧帖内容:

使用 appium 自动化测试 app
用的是 python 语言
求助,在线等

详细错误日志如下:
est_check_fresh (main.ComplexAndroidTests) ... ERROR

======================================================================

ERROR: test_check_fresh (main.ComplexAndroidTests)

Traceback (most recent call last):
File "android_simple.py", line 40, in test_check_fresh
self.driver.find_element_by_xpath("//android.widget.LinearLayout[1]/android.widget.FrameLayout[1]/android.widget.RelativeLayout[1]/android.widget.RelativeLayout[1]/android.widget.LinearLayout[1]/android.widget.RelativeLayout[1]").click()
File "/Library/Python/2.7/site-packages/selenium-2.46.0-py2.7.egg/selenium/webdriver/remote/webdriver.py", line 252, in find_element_by_xpath
return self.find_element(by=By.XPATH, value=xpath)
File "/Library/Python/2.7/site-packages/selenium-2.46.0-py2.7.egg/selenium/webdriver/remote/webdriver.py", line 684, in find_element
{'using': by, 'value': value})['value']
File "/Library/Python/2.7/site-packages/selenium-2.46.0-py2.7.egg/selenium/webdriver/remote/webdriver.py", line 195, in execute
self.error_handler.check_response(response)
File "build/bdist.macosx-10.10-intel/egg/appium/webdriver/errorhandler.py", line 29, in check_response
raise wde
WebDriverException: Message: An unknown server-side error occurred while processing the command.

代码如下:

def test_check_fresh(self):
sleep(10)
self.driver.find_element_by_xpath("//android.widget.LinearLayout[1]/android.widget.FrameLayout[1]/android.widget.RelativeLayout[1]/android.widget.RelativeLayout[1]/android.widget.LinearLayout[1]/android.widget.RelativeLayout[1]").click()

共收到 6 条回复 时间 点赞

麻烦提供一下:
1、appium server log(如果是命令行,就是命令行里的输出字符,如果是 GUI,就是里面黑色底的界面里面的内容)
2、使用环境:appium 版本、client 版本、android 版本等。

引起 Unknown server error 的原因有很多,有可能是 dump 出错,UIAutomator 挂了等等。光靠 unknown server-side error 定位不了问题的,需要 appium server log 才能比较准确地准确定位问题。

是用命令行运行的,上面的 error log 就是哦
使用环境:appium:1.4.0

1、appium server log(如果是命令行,就是命令行里的输出字符,如果是 GUI,就是里面黑色底的界面里面的内容)

#2 楼 @chocolatesweety 你贴的是 appium client 输出的 log ,一些错误细节已经被隐藏掉了,所以定位不了问题。

appium client python 2.7
server 的 log 马上发出来

#5 楼 @chocolatesweety 你好,我想问下,你上面的 log 内容,是在控制台显示的,还是重定向输出到一个文件里,我想把控制台输出的日志,写到 1 个文件里,好方便查看,但我没有查到具体的方法,不知道你能不能帮助一下

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