Skip to content

Instantly share code, notes, and snippets.

View dpgraham's full-sized avatar

Dan Graham dpgraham

  • Sauce Labs (@appium Team)
  • Vancouver, BC, Canada
View GitHub Profile

As of version (placeholder for version), Appium Inspector can be launched with a file with the '.appiumsession' extension.

Operations

File > Save

When opening Appium inspector, if you fill in the capabilities and server info and hit File > Save you will be prompted to save the .appiumsession file to a location in your file system. After closing Appium Inspector, you can re-open Appium Inspector by launching your newly created .appiumsession. If you change the contents of your capabilities or your server info during an Appium inspector, clicking "Save" will overwrite the contents.

File > Save As

➜ signup git:(GRW-222/feat/full-e2e-tests-2) ✗ npx saucectl run
Debugger listening on ws://127.0.0.1:64727/a81077ff-4d50-473e-ac99-2ee4b83283e4
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
10:13:47 INF Running version 0.34.1
10:13:47 INF Reading config file config=.sauce/config.yml
10:13:47 INF Ignoring framework version for Docker, using provided image saucelabs/stt-cypress-mocha-node:latest (only applicable to docker mode)
10:13:47 INF Running Cypress in Sauce Labs
10:13:47 INF Project archived. durationMs=50 size=1437306
10:13:49 INF Project uploaded. durationMs=1725 storageId=a043652a-cf33-4e5e-bc91-09f4384162a4
> appium-xcuitest-driver@3.34.0 e2e-test /Users/danielgraham/appium-xcuitest-driver
> gulp e2e-test
256 passing (47m)
31 pending
4 failing
1) XCUITestDriver - basics -
get geo location -
22:59:01.346 xcodebuild[21195:23228921] Beginning test session WebDriverAgentRunner-76112460-12D9-43C1-8195-91307C3FAC5A at 2020-09-22 22:59:01.344 with Xcode 11E801a on target <DVTiPhoneSimulator: 0x7fd2a53aec30> {
SimDevice: iPhone X (B4CCB5EC-66B1-436E-9F25-A5361CAEAE27, iOS 14.0, Booted)
} (14.0 (18A372))
22:59:01.346 xcodebuild[21195:23228921] /Users/danielgraham/Xcode/Xcode-11.7-beta.app/Contents/Developer/usr/bin/xcodebuild
build-for-testing
test-without-building
-project
/Users/danielgraham/appium-xcuitest-driver/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj
-scheme
WebDriverAgentRunner
@dpgraham
dpgraham / appium-workaround.md
Created December 23, 2019 22:38
setLocation workaround for Appium Android

Versions of Appium above v1.9.1 and below v1.16.0 have a bug in setLocation and getLocation that looks like this:

2019-12-23 21:57:26:835 - [HTTP] --> GET /wd/hub/session/372d6e4d-279a-4582-ab6d-90804845bcb0/location
2019-12-23 21:57:26:835 - [HTTP] {}
2019-12-23 21:57:26:836 - [debug] [MJSONWP (372d6e4d)] Calling AppiumDriver.getGeoLocation() with args: ["372d6e4d-279a-4582-ab6d-90804845bcb0"]
2019-12-23 21:57:26:837 - [debug] [ADB] Running '/home/chef/android-sdk-linux/platform-tools/adb -P 5037 -s emulator-5554 shell am broadcast -n io.appium.settings/.receivers.LocationInfoReceiver -a io.appium.settings.location'
2019-12-23 21:57:26:924 - [debug] [MJSONWP (372d6e4d)] Encountered internal error running command: Error: Cannot parse the actual location values from the command output: Broadcasting: Intent { act=io.appium.settings.location flg=0x400000 cmp=io.appium.settings/.receivers.LocationInfoReceiver }
2019-12-23 21:57:26:924 - [debug] [MJSONWP (372d6e4d)] Broadcast completed: result=0, data=""
Versions of Appium above v1.9.1 and below v1.16.0 have a bug in `setLocation` and `getLocation` that looks like this:
```
2019-12-23 21:57:26:835 - [HTTP] --> GET /wd/hub/session/372d6e4d-279a-4582-ab6d-90804845bcb0/location
2019-12-23 21:57:26:835 - [HTTP] {}
2019-12-23 21:57:26:836 - [debug] [MJSONWP (372d6e4d)] Calling AppiumDriver.getGeoLocation() with args: ["372d6e4d-279a-4582-ab6d-90804845bcb0"]
2019-12-23 21:57:26:837 - [debug] [ADB] Running '/home/chef/android-sdk-linux/platform-tools/adb -P 5037 -s emulator-5554 shell am broadcast -n io.appium.settings/.receivers.LocationInfoReceiver -a io.appium.settings.location'
2019-12-23 21:57:26:924 - [debug] [MJSONWP (372d6e4d)] Encountered internal error running command: Error: Cannot parse the actual location values from the command output: Broadcasting: Intent { act=io.appium.settings.location flg=0x400000 cmp=io.appium.settings/.receivers.LocationInfoReceiver }
2019-12-23 21:57:26:924 - [debug] [MJSONWP (372d6e4d)] Broadcast completed: result=0, data=""
MacBook-Pro:appium Daniel-Graham-SL1298$ pushd node_modules/appium-xcuitest-driver/
~/appium/node_modules/appium-xcuitest-driver ~/appium
MacBook-Pro:appium-xcuitest-driver Daniel-Graham-SL1298$ npm link appium-remote-debugger
/Users/danielgraham/appium/node_modules/appium-xcuitest-driver/node_modules/appium-remote-debugger -> /Users/danielgraham/.nvm/versions/node/v10.16.0/lib/node_modules/appium-remote-debugger -> /Users/danielgraham/appium-remote-debugger
MacBook-Pro:appium-xcuitest-driver Daniel-Graham-SL1298$ popd
~/appium
MacBook-Pro:appium Daniel-Graham-SL1298$ npx gulp transpile && node .
[15:20:14] Using gulpfile ~/appium/gulpfile.js
[15:20:14] Starting 'transpile'...
[15:20:15] Finished 'transpile' after 1 s
MacBook-Pro:appium-xcuitest-driver Daniel-Graham-SL1298$ npm run e2e-test
> appium-xcuitest-driver@2.128.2 e2e-test /Users/danielgraham/appium-xcuitest-driver
> gulp e2e-test
[13:44:01] Using gulpfile ~/appium-xcuitest-driver/gulpfile.js
[13:44:01] Starting 'e2e-test'...
[13:44:01] Starting 'transpile'...
[13:44:04] Finished 'transpile' after 2.28 s
[13:44:04] Starting 'e2e-test:run'...
dbug RemoteDebugger name: "com.apple.WebKit.WebContent"
dbug RemoteDebugger bundleId: "process-com.apple.WebKit.WebContent"
dbug RemoteDebugger hostId: "PID:44164"
dbug RemoteDebugger isActive: 0
dbug RemoteDebugger isAutomationEnabled: false
dbug RemoteDebugger pageArray: 'Waiting for data'
dbug RemoteDebugger Found app id key 'PID:44164' for bundle 'com.apple.mobilesafari'
dbug RemoteDebugger Found separate bundleId 'process-com.apple.WebKit.WebContent' acting as proxy for 'com.apple.mobilesafari', with app id 'PID:44167'
dbug RemoteDebugger Found separate bundleId 'process-com.apple.WebKit.WebContent' acting as proxy for 'com.apple.mobilesafari', with app id 'PID:44208'
dbug RemoteDebugger Trying out the possible app ids: PID:44164, PID:44167, PID:44208
dbug XCUITest Sending createSession command to WDA
dbug WD Proxy Matched '/session' to command name 'createSession'
dbug WD Proxy Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"capabilities":{"firstMatch":[{"bundleId":"com.apple.mobilesafari","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":30,"shouldUseSingletonTestManager":true}],"alwaysMatch":{}}}
dbug WD Proxy Got response with status 200: {"value":{"sessionId":"583311BC-A082-4BFF-AF33-4428EC6CC91C","capabilities":{"device":"iphone","browserName":"Safari","sdkVersion":"13.0","CFBundleIdentifier":"com.apple.mobilesafari"}},"sessionId":"583311BC-A082-4BFF-AF33-4428EC6CC91C"}
info WD Proxy Determined the downstream protocol as 'W3C'
dbug BaseDriver Event 'wdaSessionStarted' logged at 1567618976053 (10:42:56 GMT-0700 (Pacific Daylight Time))
dbug XCUITest Parsed BUILD_DIR configuration value: '/Users/danielgraham/Libra