web test automation appium / ios

s

 

http://stackoverflow.com/questions/30260150/could-not-pre-launch-appium-and-app-doesnt-get-installed-in-iphone-real-device

 

 

appium those pits

http://blog.csdn.net/mentgmery1/article/details/41645427

Those pits that run APPIUM automation on the real machine

The first pit, how to start APPIUM to ensure that it communicates with APPIUM SERVER,

 

appium -U UDID  --app Bundle ID

 

the second pit,

 

selenium.common.exceptions.WebDriverException: Message: u'A new session could not be created. (Original error: Instruments crashed on startup)' 

 

I ran into this problem twice, briefly described as follows:

For the first time, it was because the Enable UI Automation in the developer option was not turned on, and it was OK after turning it 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 that you can see the Developer option on the Settings page.

 

The second time, it was because, after changing the phone, because the phone did not support the signature of the APP I am using, resulting in the error of Instruments crashed on startup, just recompile an APP with the signature of this phone, and that's it.

 

 

third pit

The switch_to.context test always reports an error. There is no context attribute. It took a long time to find out.

 

from appium import webdriver

from selenium import webdriver

 

第二条声明把第一条给覆盖了,switch_to是appium里的方法。

 

 

第四个坑

打开浏览器操作,http://appium.io/slate/en/v1.2.1/?Python#setup76

 

 

第五个坑

Appium v1.3.1 启动IOS测试后报了如下异常,记得之前可以跑的,点里那个诊断的按钮也显示环境正常,请大家帮我看看是哪里出问题了么? 这个文件/Applications/Appium.app/Contents/Resources/node_modules/appium/build/libimobiledevice-macosx/ideviceinstaller我看也有的啊。

 

 

2014-11-04 01:26:38:474 - info: [debug] Not pre-launching simulator

2014-11-04 01:26:38:474 - info: [debug] Creating iDevice object with udid 843bb46631ac5c1408af67ae25a48d3b2e2c4888

2014-11-04 01:26:38:475 - 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:38:475 - info: [debug] Checking app install status using: /Applications/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 installed. Will 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-11-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.js:648:15)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:756:16)
    at Process.ChildProcess._handle.onexit (child_process.js:823:5)

2014-11-04 01:26:40:839 - error: Failed to start an Appium session, err was: 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


2014-11-04 01:26:40:840 - info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be 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 500 4929.943 ms - 668 

这个就是你的ideviceinstaller没装好,brew install ideviceinstaller 执行

 

第五个坑

 

"message":"A new session could not be created. (Original error: Instruments crashed on startup)","origValue":"Instruments crashed on startup"},"sessionId":null}

 

一般出现这个问题,都是你的APP的签名跟设备的不一样导致,保持一致就可以了

 

第六个坑

 

第七个坑

安装特定版本的APPIUM

npm install -g [email protected]

 

第八个坑

在真机上生成的APP文件和在模拟器(simulator)上生成的是不一样的,用inspector的时候,只能使用模拟器生成的APP文件

 

第九个坑

UIAPickerWheel, 比如 picker里面有4个选项, latest day, last 7 days, last 30 days, all, 这个时候只需要UIAPickerWheel.send_keys(latest day),就可以设置picker里的值

 

第十个坑

通过INSPECTOR,发现有多个元素的名字都是一样的,我们可以通过find_elements_by_name方法(记住是elements)遍历所有相同名字的元素,然后根据INDEX取其中我们想要的,例如,

def getPicker(self):

elements = find_elements_by_name("picker normal")

return elements[1]

 

appium 真机测试问题 出现 instruments crashed on startup

http://blog.csdn.net/a542551042/article/details/45723415

1.appium 真机测试的时候 instruments crashed on startup,必须在真机上打开UI Automation

在设置里: 
Developer—>Enable UI Automation 
开启这几即可 
ps: 

如果在iOS设置里面,没有找到开发这个选项,那么需要连接上Xcode,之后再去查看iOS 设备上的设置,就看到开发者选项了 

或者: 
App签名包,和本机的Xcode配置的签名不一致, 

(在使用真机调试的App的时候,必须保证通过Xcode 的Instrument能够正常的调试真机才可以,否则Appium 无法调试真机的)

2.真机测试的时候,必须确保手机已经安装要测试app

3.确定ios已经绑定开发者证书,并且使用Xcode 能够运行真机

4.运行真机的时候,确保Instrument 已经关闭

 

Appium [iOS] Instruments crashed on startup

http://stackoverflow.com/questions/33546980/appium-ios-instruments-crashed-on-startup

 

MAC_iOS自动化环境搭建.zip 

 

end

 

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326691924&siteId=291194637