Those pits that run Appium automation on the real machine
First pit, how to start appium to ensure it communicates with Appium server,
Appium-u UDID--app Bundle ID
A second pit,
Selenium.common.exceptions.webdriverexception:message:u ' A new session could not be created. (Original error:instruments crashed on startup) '
I have encountered this problem two times, briefly described as follows:
First, it is because the Enable UI in the developer option automation the wood is on, and it is OK when it is turned on. Explain here, the premise of running Appium on the real machine is that the mobile phone should be registered as a developer mobile phone, so you can see the Developer (Developer) option on the Settings page.
The second time, because, after changing the phone, because the phone does not support the signature of the app I am using now, resulting in the instruments crashed on startup error, as long as the signature of this phone to recompile an app, you can.
Third Pit
Switch_to.context test, always error, no context this attribute, find le half a day only to find,
From Appium import Webdriver
From selenium import Webdriver
The second statement covers the first article, and Switch_to is the method in Appium.
Fourth pit
Open browser operation, http://appium.io/slate/en/v1.2.1/?python#setup76
Fifth Pit
Appium v1.3.1 start iOS test reported the following exception, remember before you can run, the point of the diagnostic button also shows that the environment is normal, please help me to see where the problem is. This file/applications/appium.app/contents/resources/node_modules/appium/build/libimobiledevice-macosx/ Ideviceinstaller I see there are also ah.
2014-11-04 01:26:38:474-info: [Debug] not pre-launching simulator 2014-11-04 01:26:38:474-info: [Debug] Creating Idev Ice object with Udid 843bb46631ac5c1408af67ae25a48d3b2e2c4888 2014-11-04 01:26:38:475-info: [debug] couldn ' t find Idevi Ceinstaller, trying built-in at/applications/appium.app/contents/resources/node_modules/appium/build/ Libimobiledevice-macosx/ideviceinstaller 2014-11-04 01:26:38:475-info: [Debug] Checking app install status using:/APPL Ications/appium.app/contents/resources/node_modules/appium/build/fruitstrap/fruitstrap isInstalled--id 843bb46631ac5c1408af67ae25a48d3b2e2c4888--bundle com.terrytest.test 2014-11-04 01:26:40:637-info: [Debug] App is not I Nstalled.
Try to install the app. 2014-11-04 01:26:40:637-info: [debug] Installing IPA found At/users/sunqingwei/evan/terrytest/mobile/test.ipa 2014-11 -04 01:26:40:637-info: [Debug] Creating IDevice object with Udid 843bb46631ac5c1408af67ae25a48d3b2e2c4888 2014-11-04 01: 26:40:638-info: [Debug] Couldn ' t find Ideviceinstaller, trying built-in at/applications/appium.app/contents/resources/node_modules/appium/ Build/libimobiledevice-macosx/ideviceinstaller 2014-11-04 01:26:40:839-info: [debug] Cleaning up Appium session 2014-1 1-04 01:26:40:840-info: [Debug] Error:command failed:dyld:Library not loaded: @executable_path/.. /lib/libimobiledevice.3.dylib referenced from:/applications/appium.app/contents/resources/node_modules/appium/ Build/libimobiledevice-macosx/ideviceinstaller reason:image not found at Childprocess.exithandler (CHILD_PROCESS.J S:648:15) at Childprocess.emit (events.js:98:17) at Maybeclose (child_process.js:756:16) at Process.childproce Ss._handle.onexit (child_process.js:823:5) 2014-11-04 01:26:40:839-error:failed to start an Appium session, err Was:e Rror:command failed:dyld:Library not loaded: @executable_path/.. /lib/libimobiledevice.3.dylib referenced from:/applications/appium.app/contents/resources/node_modules/appium/bUild/libimobiledevice-macosx/ideviceinstaller reason:image not found 2014-11-04 01:26:40:840-info: [Debug] Respondi ng to client with error: {"status": $, "value": {"message": "A new session could not is created. (Original Error:command failed:dyld:Library not loaded: @executable_path/.. /lib/libimobiledevice.3.dylib\n referenced from:/applications/appium.app/contents/resources/node_modules/appium/ build/libimobiledevice-macosx/ideviceinstaller\n reason:image not found\n) "," killed ": false," code ": null," Signal ":" SIGTRAP "," Origvalue ":" Command failed:dyld:Library not loaded: @executable_path/.. /lib/libimobiledevice.3.dylib\n referenced from:/applications/appium.app/contents/resources/node_modules/appium/ build/libimobiledevice-macosx/ideviceinstaller\n reason:image not found\n "}," SessionId ": null} 2014-11-04 01:26:40:841-info: <--post/wd/hub/session 4929.943 ms-668
This is your ideviceinstaller. Brew Install Ideviceinstaller Execute
Fifth Pit
"Message": "A new session could not being created. (Original error:instruments crashed on startup) "," Origvalue ":" Instruments crashed on Startup "}," SessionId ": null}
In general, the problem is that your app's signature is not the same as the device, so you can keep it consistent.
Sixth pit
Seventh Pit
Install a specific version of Appium
NPM install-g appium@0.12.3
Eighth Pit
The app files generated on the real machine are not the same as those generated on the emulator (simulator), only the app files generated by the simulator can be used with inspector.
Ninth Pit.
Uiapickerwheel, for example, has 4 options in the picker, latest day, last 7 days, the last of all, and all, this time only needs Uiapickerwheel.send_keys (latest), You can set the value in the picker.
Tenth pit
By inspector, it is found that the names of multiple elements are the same, and we can traverse all elements of the same name through the Find_elements_by_name method (remember, elements), and then take what we want from index, for example,
def getpicker (self):
elements = Find_elements_by_name ("Picker normal")
return elements[1]