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 / 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
[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'
[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
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 {"requiredCapabilities":{},"desiredCapabilities":{"nativeWebTap":true,"deviceName":"iPhone Simulator","automationName":"XCUITest","newCommandTimeout":"120","platformName":"iOS","app":"/Users/rafalfusik/Desktop/UICatalog.app"}}
[MJSONWP] Calling AppiumDriver.createSession() with args: [{"nativeWebTap":true,"devi...
[Appium] Creating new XCUITestDriver session
[Appium] Capabilities:
[Appium] nativeWebTap: true
[Appium] deviceName: 'iPhone Simulator'
[Appium] automationName: 'XCUITest'
[Appium] newCommandTimeout: '120'
[Appium] platformName: 'iOS'
@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)
@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 / 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 / sendEmailAws.py
Last active September 9, 2016 19:26
Send Email - Amazon SES SMTP Endpoint (TLS)
#
# to send emails via Amazon SES SMTP (TLS)
#
def sendMail(self, subject, email_content):
import smtplib
from email.MIMEMultipart import MIMEMultipart
from email.MIMEBase import MIMEBase
from email import Encoders
@rafalf
rafalf / testUserCredentials.ps1
Last active August 28, 2016 15:14
Test windows user credentials
#
# Returns True if Password matches, False otherwise
#
Function Test-UserCredential {
Param($username, $password)
Add-Type -AssemblyName System.DirectoryServices.AccountManagement
$ct = [System.DirectoryServices.AccountManagement.ContextType]::Machine, $env:computername
$opt = [System.DirectoryServices.AccountManagement.ContextOptions]::SimpleBind
$pc = New-Object System.DirectoryServices.AccountManagement.PrincipalContext -ArgumentList $ct
$Result = $pc.ValidateCredentials($username, $password).ToString()