附上旧帖内容:

使用 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()


↙↙↙阅读原文可查看相关链接,并与作者交流