Appium 求助:第一次在 mac 上运行 Appium 的 sample code,两条 case 全部失败

mango · March 31, 2015 · Last by 水煮胳膊 replied at April 27, 2015 · 1813 hits

我的 mac 是 10.10.2 的系统,已经安装了 Appium 的 app,启动正常
然后运行 Appium 的 sample code,控制台运行结果如下
MacBook-Pro:python real$ python ios_simple.py
test_scroll (main.SimpleIOSTests) ... ERROR
test_ui_computation (main.SimpleIOSTests) ... ERROR

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

ERROR: test_scroll (main.SimpleIOSTests)

Traceback (most recent call last):
File "ios_simple.py", line 57, in test_scroll
el = self.driver.find_element_by_accessibility_id('OK')
File "build/bdist.macosx-10.10-intel/egg/appium/webdriver/webdriver.py", line 135, in find_element_by_accessibility_id
return self.find_element(by=By.ACCESSIBILITY_ID, value=id)
File "/Library/Python/2.7/site-packages/selenium-2.45.0-py2.7.egg/selenium/webdriver/remote/webdriver.py", line 664, in find_element
{'using': by, 'value': value})['value']
File "/Library/Python/2.7/site-packages/selenium-2.45.0-py2.7.egg/selenium/webdriver/remote/webdriver.py", line 175, 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
NoSuchElementException: Message: An element could not be located on the page using the given search parameters.

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

ERROR: test_ui_computation (main.SimpleIOSTests)

Traceback (most recent call last):
File "ios_simple.py", line 42, in test_ui_computation
self._populate()
File "ios_simple.py", line 32, in _populate
els = self.driver.find_elements_by_ios_uiautomation('elements()')
File "build/bdist.macosx-10.10-intel/egg/appium/webdriver/webdriver.py", line 101, in find_elements_by_ios_uiautomation
return self.find_elements(by=By.IOS_UIAUTOMATION, value=uia_string)
File "/Library/Python/2.7/site-packages/selenium-2.45.0-py2.7.egg/selenium/webdriver/remote/webdriver.py", line 679, in find_elements
{'using': by, 'value': value})['value']
File "/Library/Python/2.7/site-packages/selenium-2.45.0-py2.7.egg/selenium/webdriver/remote/webdriver.py", line 175, 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 error occurred while executing user supplied JavaScript.


Ran 2 tests in 20.406s

FAILED (errors=2)

我的 xcode 是 6.1.1 之前没有运行过 iOS simulator

我的 Appium 的 App 上的 log 如下:
有如下 warning
warn: Applications directory /Users/real/Library/Developer/CoreSimulator/Devices/D1E53AD9-33EE-4BE7-A534-0D465845F814/data/Containers/Data/Application doesn't exist. Have you run this simulator before?
warn: Applications directory /Users/real/Library/Developer/CoreSimulator/Devices/D1E53AD9-33EE-4BE7-A534-0D465845F814/data/Containers/Bundle/Application doesn't exist. Have you run this simulator before?

共收到 5 条回复 时间 点赞

sample code 麻烦自己修复了,再跑,本来官方没有说 100% 通过啊。

Sample 已经年久失修了。。

mango #3 · April 01, 2015 Author

关键怎么调试啊?

mango #4 · April 02, 2015 Author

有没有人能解答啊?

弱弱的问一句 问题解决了吗
我也遇到了 test_ui_computation 的问题 心塞 ing

需要 Sign In 后方可回复, 如果你还没有账号请点击这里 Sign Up