1.在脚本中会有:from appium import webdriver
第一次运行时可能会遇到这样的 error:No module named appium
之所以会报这样的 error 是因为没有装 client
client 下载地址 :https://github.com/appium/python-clienthttps://github.com/appium/python-clienthttps://github.com/appium/python-client
下载下来后,python setup.py install
可能在安装过程中会遇到权限问题
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.9-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.42.1-py2.7.egg/selenium/webdriver/remote/webdriver.py", line 662, in find_element
{'using': by, 'value': value})['value']
File "/Library/Python/2.7/site-packages/selenium-2.42.1-py2.7.egg/selenium/webdriver/remote/webdriver.py", line 173, in execute
self.error_handler.check_response(response)
File "build/bdist.macosx-10.9-intel/egg/appium/webdriver/errorhandler.py", line 29, in check_response
raise wde
NoSuchElementException: Message: u'An element could not be located on the page using the given search parameters.'
这样的 error 是因为 Python 测试代码有问题,appium 自带的代码和 server 不匹配,你可以更改一下代码中 app 的路径就 ok 了。