月份: 八月 2014

[Appium][Issue][1.2.2] iOS log capture failed: spawn ENOENT (deviceconsole)

Appium 1.2.2 一啟動 iOS 時會出現下面的錯誤:

info: [debug] Starting iOS device log capture via deviceconsole
error: iOS log capture failed: spawn ENOENT
info: [debug] Cleaning up appium session
error: Failed to start an Appium session, err was: Error: spawn ENOENT
info: [debug] Error: spawn ENOENT
    at errnoException (child_process.js:1000:11)
    at Process.ChildProcess._handle.onexit (child_process.js:791:34)
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: spawn ENOENT)","code":"ENOENT","errno":"ENOENT","syscall":"spawn","origValue":"spawn ENOENT"},"sessionId":null}
info: <-- POST /wd/hub/session 500 1780.745 ms - 197
info: [debug] Not setting device type since we're connected to a device
info: [debug] Getting bundle ID from app
info: [debug] Parsed app Info.plist (as binary)
info: [debug] Creating iDevice object with udid 816008f7ad15fcdc53f97dec30ad6e543d186faa
info: [debug] Checking app install status using: /usr/local/lib/node_modules/appium/build/fruitstrap/fruitstrap isInstalled --id 816008f7ad15fcdc53f97dec30ad6e543d186faa --bundle tw.com.skysoft.iPhone

原因是 Appium 1.2.2 開始改用 deviceconsole (#3430),但 $APPIUM_HOME/build/deviceconsole 底下卻又找不到 deviceconsole 的關係。

繼續閱讀 “[Appium][Issue][1.2.2] iOS log capture failed: spawn ENOENT (deviceconsole)"

一些提升 Assertion 可讀性的方式

在使用 JUnit 時,我習慣使用一些方式以提升 Assertion 的可讀性:

1. 將預期的結果放在前面,以方便對照(也符合 JUnit Assert 的說明規範)
2. 在擁有多個 Assertions 的測試,選用有 message 參數的 Assertion,以方便在出現錯誤時印出我們給予的資訊,輔助判斷情況和位置
3. 如果要比物件的話,盡量善用比對其種類的 Assertion,盡量不要自己比過才 Assert,因為直接比對的話會比較貼近原始資料,若比對不符所印出來的資訊也比較完整
繼續閱讀 “一些提升 Assertion 可讀性的方式"

[Jenkins][Issue] Artifact 的 Local Copy 毀損時仍被判定為有效而不會重新下載 (Python)

透過 Python API (JenkinsAPI 取得 artifacts 時,通常都是透過:
理想上,Artifact.save() 會檢查 local copy 的 fingerprint 是否跟 server 上的 artifact 一致,如果 local copy 有問題才會重新下載。但過程中,如果你觀察到有下面的 logs 出現,可能就得小心了…
DEBUG:requests.packages.urllib3.connectionpool:"GET /fingerprint/9fb189f24862ce8b96468df4ebc50629/api/python HTTP/1.1" 404 None
ERROR:root:Failed request at https://<JENKINS_SERVER>/fingerprint/9fb189f24862ce8b96468df4ebc50629/api/python with params: None
INFO:jenkinsapi.artifact:Local copy of <ARTIFACT_NAME> is already up to date.

繼續閱讀 “[Jenkins][Issue] Artifact 的 Local Copy 毀損時仍被判定為有效而不會重新下載 (Python)"

從 Robot Framework 傳進 Appium 的參數,包含空白時,iOS 裝置會跳出錯誤

最近在用 Robot Framework 搭配 Appium 使用,發生了一件有點奇妙的事情。

在 Appium 裡,要 setText,是用 send_keys(text) 或 set_value(text) 來達成,set_value(text) 在 Android 裝置沒有實作,只有 iOS 可以使用,send_keys(text) 則是兩個裝置皆可使用。但由於 Android 跟 iOS 底層實作方式可能不太一樣,導致使用 send_keys(text) 行為上有一些小差異。 繼續閱讀 “從 Robot Framework 傳進 Appium 的參數,包含空白時,iOS 裝置會跳出錯誤"

[Appium][Issue] iOS 實機擷圖經常遇到 Timed Out 的錯誤

擷取畫面的動作,在 iOS 上偶爾會出現 timed out 的問題。
Appium 1.2.0 + iOS 7.1
WebDriverException: Message: u"An unknown server-side error occurred while processing the command. (Original error: Timed out waiting for screenshot file. Error: ENOENT, open '/tmp/appium-instruments/Run 1/screenshot6450a989-1854-4469-8116-ee4e6ae56183.png')"

繼續閱讀 “[Appium][Issue] iOS 實機擷圖經常遇到 Timed Out 的錯誤"