Skip to content

Instantly share code, notes, and snippets.

View rafalf's full-sized avatar

Rafal Fusik rafalf

  • freelancer
  • Dublin
View GitHub Profile
@rafalf
rafalf / appium.log
Created October 15, 2016 08:31
appium starts up twice for Safari (iOS)
appium log (with caps):
[Appium] Welcome to Appium v1.6.0
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] --> POST /wd/hub/session {"requiredCapabilities":{},"desiredCapabilities":{"nativeWebTap":true,"deviceName":"iPhone Simulator","automationName":"XCUITest","browserName":"safari","safariIgnoreFraudWarning":true,"newCommandTimeout":"120","platformVersion":"10.0","fullReset":"true","platformName":"iOS"}}
[MJSONWP] Calling AppiumDriver.createSession() with args: [{"nativeWebTap":true,"devi...
[Appium] Creating new XCUITestDriver session
[Appium] Capabilities:
[Appium] nativeWebTap: true
[Appium] deviceName: 'iPhone Simulator'
@rafalf
rafalf / gist:8c3eac2c8e184ccb3a3b5db1b621349e
Created October 24, 2016 15:46
appium shutting - android emulator
[Chromedriver] [STDOUT] Starting ChromeDriver 2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4) on port 8000
Only local connections are allowed.
[JSONWP Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8000/wd/hub/status] with no body
[JSONWP Proxy] Got response with status 200: "{\"sessionId\":\"\",\"status\":0,\"value\":{\"build\":{\"version\":\"alpha\"},\"os\":{\"arch\":\"x86_64\",\"name\":\"Windows NT\",\"version\":\"10.0\"}}}"
[JSONWP Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8000/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.android.chrome","androidDeviceSerial":"emulator-5554"}}}
[JSONWP Proxy] Got response with status 200: {"sessionId":"37d95834048f41e54710bb1a58932a9e","status":13,"value":{"message":"unknown error: Chrome version must be >= 46.0.2490.0\n (Driver info: chromedriver=2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4),platform=Windows NT 10.0 x86_64)"}}
[debug] [Chromedriver] Changed state to 'online'
[Appium] Ne
@rafalf
rafalf / google_test.py
Created October 24, 2016 15:50
appium test
class ChromeTests(unittest.TestCase):
def setUp(self):
desired_caps = {
'platformName': 'Android',
'platformVersion': '5.1.1',
'deviceName': 'Android Emulator',
'browserName': 'Chrome'
}
self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
Welcome to Appium v1.4.16
===========
info: --> POST /wd/hub/session/26547f0b-d547-48b9-aeb8-66d62730b5d8/touch/perform {"sessionId":"26547f0b-d547-48b9-aeb8-66d62730b5d8","actions":[{"action":"tap","options":{"y":"269","x":"239","count":1,"element":"48"}}]}
> info: [debug] Pushing command to appium work queue: ["element:getLocation",{"elementId":"48"}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"element:getLocation","params":{"elementId":"48"}}
> info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
> info: [debug] [BOOTSTRAP] [debug] Got command action: getLocation
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"status":0,"value":{"x":37,"y":220}}
> info: [debug] Pushing command to appium work queue: ["element:getSize",{"elementId":"48"}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"element:getSize","params":{"elementId":"48"}}
[HTTP] <-- POST /wd/hub/session/9cf3c30b-acd0-48da-afc6-d35e609942f6/touch/perform 200 3130 ms - 76
[HTTP] --> POST /wd/hub/session/9cf3c30b-acd0-48da-afc6-d35e609942f6/touch/perform {"sessionId":"9cf3c30b-acd0-48da-afc6-d35e609942f6","actions":[{"action":"longPress","options":{"y":"269","x":"239","duration":500}}]}
[MJSONWP] Calling AppiumDriver.performTouch() with args: [[{"action":"longPress","options":{"y":"269","x":"239","duration":500}}],"9cf3c30b-acd0-48da-afc6-d35e609942f6"]
[debug] [AndroidBootstrap] Sending command to android: {"cmd":"action","action":"element:touchDown","params":{"x":"239","y":"269"}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {"cmd":"action","action":"element:touchDown","params":{"x":"239","y":"269"}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: touchDown
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Display bounds: [0,0][480,800]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] P
[HTTP] --> POST /wd/hub/session {"requiredCapabilities":{},"desiredCapabilities":{"showXcodeLog":true,"automationName":"XCUITest","platformName":"iOS","app":"/Users/rafalfusik/Desktop/UICatalog.app","newCommandTimeout":"120"}}
[MJSONWP] Calling AppiumDriver.createSession() with args: [{"showXcodeLog":true,"auto...
[Appium] Creating new XCUITestDriver session
[Appium] Capabilities:
[Appium] showXcodeLog: true
[Appium] automationName: 'XCUITest'
[Appium] platformName: 'iOS'
[Appium] app: '/Users/rafalfusik/Desktop/UICatalog.app'
[Appium] newCommandTimeout: '120'
[Appium] deviceName: 'iPhone 6'
@rafalf
rafalf / gist:a039a032c3d2f58171a23dccf71e846f
Created November 4, 2016 07:54
appium-1.6-log-failure
[HTTP] --> POST /wd/hub/session/54625080-eaee-45cd-922e-f64979836054/touch/perform {"sessionId":"54625080-eaee-45cd-922e-f64979836054","actions":[{"action":"tap","options":{"y":null,"x":null,"count":1,"element":"39"}}]}
[MJSONWP] Calling AppiumDriver.performTouch() with args: [[{"action":"tap","options":{"y":null,"x":null,"count":1,"element":"39"}}],"54625080-eaee-45cd-922e-f64979836054"]
[debug] [AndroidBootstrap] Sending command to android: {"cmd":"action","action":"element:getLocation","params":{"elementId":"39"}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {"cmd":"action","action":"element:getLocation","params":{"elementId":"39"}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: getLocation
[debug] [AndroidBootstrap] Received command result from bootstrap
[debug] [AndroidBootstrap] Sending command to android: {"cmd":"action","action":"element:getSize","params":{"elementId":"39"}}
[AndroidBootstrap] [BO
@rafalf
rafalf / gist:23c02967b1e3dafcc428f27d0375d63d
Created November 4, 2016 07:55
appium-1.6-log-failure-logcat
--------- beginning of main
I/CoreCoach( 2707): Synch completed
I/CoreCoach( 2707): Synch is in progress....
I/CoreCoach( 2707): Last Synch time .. 1478245821615
W/PushPull Helper( 2707): get updated tables : 1478245821615
--------- beginning of main
D/Remote Repository( 3140): Get request : Request{method=GET, url=http://demoapp3v2-env-live.ap-southeast-1.elasticbeanstalk.com/v2/GetUpdatedTableNames?timestamp=1478246849639, tag=null}
D/Remote Repository( 3140): Get response : Response{protocol=http/1.1, code=200, message=OK, url=http://demoapp3v2-env-live.ap-southeast-1.elasticbeanstalk.com/v2/GetUpdatedTableNames?timestamp=1478246849639}
D/Remote Repository( 3140): Get response : com.squareup.okhttp.internal.http.RealResponseBody@2bb133a5
E/PushPull Helper( 3140): Response received, parsing.. {"success":true,"ErrorCode":100,"message":"completed sucessfully","items":[],"ServerCurrentTime":1478246923362,"recordCount":0}
# http://gspread.readthedocs.io/en/latest/oauth2.html#
# http://alexsavio.github.io/gspread_oauth2client_intro.html
# SHARE with the json email - http://stackoverflow.com/questions/37602460/gspread-exceptions-spreadsheetnotfound
# https://github.com/burnash/gspread
import gspread
from oauth2client.service_account import ServiceAccountCredentials
import time
import requests
from bs4 import BeautifulSoup