Appium的DesiredCapabilities參數設定

來源:互聯網
上載者:User

標籤:sarg   browser   col   exe   popup   line   link   cal   檔案夾   

Appium的DesiredCapabilities參數設定

DesiredCapabilities 負責啟動服務端時的參數設定。實際使用時根據自己的需要,可自行修改一些參數。

比如,應用程式在尋找某個頁面的元素時,定位可能會時間超長。預設的命令間隔時間是60s,如果在60s內沒有找到,就會自動結束。可以使用newCommandTimeout設定為更大的數值。

capabilities.setCapability("newCommandTimeout",240);

比如,最開始使用appium時,設定了上面的安裝apk的路徑,結果安裝後偵錯工具發現介面無返回資料。後來定位問題是因為安裝時進行了重簽名。程式的保護機制讓資料無返回了。可以使用noSign設定來避免重簽名。

capabilities.setCapability("noSign","true");

當然,後來發現不在程式裡寫檔案路徑,而是提前安裝好測試包,這樣就避免了每次都要重新安裝。

完整的 Server參數

http://appium.io/slate/en/master/?ruby#appium-server-capabilities

**Server capabilities**Capability           Appium 、SelendroidplatformName         平台的名稱:iOS, Android, or FirefoxOSplatformVersion      移動裝置的系統版本號碼,7.1, 4.4deviceName           IOS:instruments -s devices,Android:隨便寫app                  安裝檔案路徑:/abs/path/to/my.apk or http://myapp.com/app.ipabrowserName          測試的web瀏覽器,如果是測app則忽略newCommandTimeout    等待新命令的最長時間,逾時後退出。預設是60sautoLaunch           是否自動安裝和啟動,預設truelanguage             模擬器的語言設定locale               模擬器的地區設定udid                 裝置號orientation          模擬器的橫豎屏設定autoWebview          Move directly into Webview contextnoReset              在當前session前不重設app狀態fullReset            ios刪除檔案夾,Android刪除app資料。**android only**appActivity                 要啟動的ActivityappPackage                  要啟動的包appWaitActivity             等待的ActivityappWaitPackage              等待的包 deviceReadyTimeout          等待裝置就緒的時間androidCoverage             enablePerformanceLogging    (Chrome and webview only)default=falseandroidDeviceReadyTimeoutandroidDeviceSocketavdavdLaunchTimeoutavdReadyTimeoutavdArgsuseKeystorekeystorePathkeystorePasswordkeyAliaskeyPasswordchromedriverExecutableautoWebviewTimeoutintentActionintentCategoryintentFlagsoptionalIntentArgumentsunicodeKeyboardresetKeyboardnoSign              Skip checking and signing,work only with UiAutomator and not with selendroidignoreUnimportantViews**ios  only**calendarFormatbundleIdudidlaunchTimeoutlocationServicesEnabledlocationServicesAuthorizedautoAcceptAlertsnativeInstrumentsLibnativeWebTapsafariAllowPopupssafariIgnoreFraudWarningsafariOpenLinksInBackgroundkeepKeyChainslocalizableStringsDirprocessArgumentsinterKeyDelayshowIOSLog

Appium的DesiredCapabilities參數設定

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.