ok,搞定了,原来是模拟器设备的设备名称和系统版本的设置问题
但问题是,app path 我已经设置好啦,但是就是一点击 Launch 就出现这个情况,我也试过自己手动提前打开模拟器,但是还是一样的错误
你好,我在运行官方给的例子的时出现了这个错误,但是不知道该怎么解决,能帮个忙吗?
kevindeMacBook-Pro:python kevin$ 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 "/Library/Python/2.7/site-packages/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/webdriver/remote/webdriver.py", line 662, in find_element
{'using': by, 'value': value})['value']
File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 173, in execute
self.error_handler.check_response(response)
File "/Library/Python/2.7/site-packages/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 "/Library/Python/2.7/site-packages/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/webdriver/remote/webdriver.py", line 677, in find_elements
{'using': by, 'value': value})['value']
File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 173, in execute
self.error_handler.check_response(response)
File "/Library/Python/2.7/site-packages/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 23.224s
FAILED (errors=2)