Skip to content

Instantly share code, notes, and snippets.

View vicwomg's full-sized avatar

Vicwomg vicwomg

  • San Francisco
View GitHub Profile
#!/usr/bin/python
import os
import sys
def moveWindowToZero(windowName):
print "Moving window '%s' to (0,0)" % windowName
cmd="""
osascript<<END
tell application "System Events"
[HTTP] --> GET /wd/hub/session/e47fef22-f2db-47af-97fa-c7884266e251/contexts {}
[MJSONWP] Calling AppiumDriver.getContexts() with args: ["e47fef22-f2db-47af-97fa-c...
[debug] [iOS] Executing iOS command 'getContexts'
[debug] [iOS] Getting list of available contexts
[debug] [iOS] Retrieving contexts and views
[debug] [iOS] Selecting by url: false
[debug] [RemoteDebugger] useNewSafari --> false
[debug] [RemoteDebugger] Debugger socket connected to ::1:27753
[HTTP] --> GET /wd/hub/session/bb790c32-b6e3-4db1-91c9-2565304035c2/contexts {}
[MJSONWP] Calling AppiumDriver.getContexts() with args: ["bb790c32-b6e3-4db1-91c9-2...
[debug] [iOS] Executing iOS command 'getContexts'
[debug] [iOS] Getting list of available contexts
[debug] [iOS] Retrieving contexts and views
[debug] [iOS] Selecting by url: false
[debug] [RemoteDebugger] useNewSafari --> false
[debug] [RemoteDebugger] Debugger socket connected to ::1:27753
@vicwomg
vicwomg / simulator_populator
Created July 31, 2015 21:13 — forked from cabeca/simulator_populator
This script removes and recreates all simulators in Xcode 6.
#!/usr/bin/env ruby
device_types_output = `xcrun simctl list devicetypes`
device_types = device_types_output.scan /(.*) \((.*)\)/
runtimes_output = `xcrun simctl list runtimes`
runtimes = runtimes_output.scan /(.*) \(.*\) \((com.apple[^)]+)\)$/
devices_output = `xcrun simctl list devices`
devices = devices_output.scan /\s\s\s\s(.*) \(([^)]+)\) (.*)/
@vicwomg
vicwomg / gist:35705da6cab74f50a23c
Created June 30, 2015 23:06
selendroid backgrounding bug
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.4.1","revision":"ce6220829063679bcccf5724515c29569c4a16d9"}}}
info: <-- GET /wd/hub/status 200 0.584 ms - 104 {"status":0,"value":{"build":{"version":"1.4.1","revision":"ce6220829063679bcccf5724515c29569c4a16d9"}}}
info: --> POST /wd/hub/session {"desiredCapabilities":{"automationName":"Selendroid","app":"http://central.maven.org/maven2/io/selendroid/selendroid-test-app/0.15.0/selendroid-test-app-0.15.0.apk","platformVersion":"4.4","deviceName":"Emulator","platformName":"Android","appActivity":".HomeScreenActivity","appWaitActivity":".HomeScreenActivity","appPackage":"io.selendroid.testapp"}}
info: Welcome to Appium v1.2.2 (REV cf6ff5939ddc6b4d45fcbabfbfe13c950e0058c4)
info: Appium REST http interface listener started on 0.0.0.0:4723
info: [debug] Non-default server args: {"app":"/Users/vic/p4/home/vic/qa/automation/mobile/pandora/builds/Pandora.app","sessionOverride":true,"deviceName":"iPhone Retina (4-inch)","showSimulatorLog":true,"defaultCommandTimeout":7200}
warn: Deprecated server args: {"--show-sim-log":"use instead: --show-ios-log"}
info: LogLevel: debug
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.2.2","revision":"cf6ff5939ddc6b4d45fcbabfbfe13c950e0058c4"}}}
@vicwomg
vicwomg / gist:5000464e5eb49e3ef0e8
Created October 24, 2014 22:01
Appium session fails with null on second launch
info: --> POST /wd/hub/session {"desiredCapabilities":{"newCommandTimeout":900,"platformVersion":"7.1","app":"/Users/jblaze/Library/Developer/Xcode/DerivedData/Soda-dcldacmuyckglggreroxonotfoyr/Build/Products/Release-iphonesimulator/SodaDev.app","platformName":"iOS","deviceName":"iPhone Simulator","browserName":"","locale":"en_US","language":"en"}}
debug: Appium request initiated at /wd/hub/session
debug: Request received with params: {"desiredCapabilities":{"newCommandTimeout":900,"platformVersion":"7.1","app":"/Users/jblaze/Library/Developer/Xcode/DerivedData/Soda-dcldacmuyckglggreroxonotfoyr/Build/Products/Release-iphonesimulator/SodaDev.app","platformName":"iOS","deviceName":"iPhone Simulator","browserName":"","locale":"en_US","language":"en"}}
debug: Using local app from desired caps: /Users/jblaze/Library/Developer/Xcode/DerivedData/Soda-dcldacmuyckglggreroxonotfoyr/Build/Products/Release-iphonesimulator/SodaDev.app
debug: Creating new appium session 82f615d1-db10-4ff7-8dd9-b096a63bf6b9
debug: Removing
@vicwomg
vicwomg / gist:6543252
Created September 12, 2013 20:25
Adb OOM on selendroid/appium
I/PANDORA (16686): >>> [22.090] ACTIVITY [WelcomeActivity] [-1253330984] onCreate
D/dalvikvm(16686): GC_CONCURRENT freed 1567K, 59% free 10356K/24744K, paused 12ms+0ms, total 25ms
D/dalvikvm(16686): GC_FOR_ALLOC freed 72K, 56% free 10901K/24744K, paused 12ms, total 12ms
I/dalvikvm-heap(16686): Forcing collection of SoftReferences for 14745612-byte allocation
D/dalvikvm(16686): GC_BEFORE_OOM freed 1K, 56% free 10900K/24744K, paused 18ms, total 18ms
E/dalvikvm-heap(16686): Out of memory on a 14745612-byte allocation.
I/dalvikvm(16686): "main" prio=5 tid=1 RUNNABLE
I/dalvikvm(16686): | group="main" sCount=0 dsCount=0 obj=0xb4e0c938 self=0xb9dd0e80
I/dalvikvm(16686): | sysTid=16686 nice=0 sched=0/0 cgrp=[fopen-error:2] handle=-1207238496
I/dalvikvm(16686): | state=R schedstat=( 0 0 0 ) utm=88 stm=83 core=0
@vicwomg
vicwomg / gist:6534319
Created September 12, 2013 08:12
appium socket hang up
POST /wd/hub/session/75bf5855-77df-4898-9265-34ad0b23668b/element/14f51212-29ef-4bd8-83cf-76dad1ced09b/click 200 644ms - 87
debug: Appium request initiated at /wd/hub/session/75bf5855-77df-4898-9265-34ad0b23668b/element
info: Making http request with opts: {"url":"http://localhost:8080/wd/hub/session/75bf5855-77df-4898-9265-34ad0b23668b/element","method":"POST","json":{"using":"id","value":"email"}}
debug: Request received with params: {"using":"id","value":"email"}
debug: Proxying command to localhost:8080
POST /wd/hub/session/75bf5855-77df-4898-9265-34ad0b23668b/element 500 239ms - 77