Skip to content

Instantly share code, notes, and snippets.

View saikrishna321's full-sized avatar
:octocat:
Focusing

Sai Krishna saikrishna321

:octocat:
Focusing
View GitHub Profile
@saikrishna321
saikrishna321 / gist:231840bee2d81d822d31
Created March 16, 2015 07:17
Validate if keyboard is visible in calabash android
Then(/^i should see the keyboard on the screen$/) do
assert_true(keyboard_visible?, 'Keyboard was not displayed')
end
def keyboard_visible?
system('adb shell dumpsys input_method > system_prop.txt')
if File.open('system_prop.txt').lines.any? { |line| line.include?('mInputShown=true') }
return true
else
return false
@saikrishna321
saikrishna321 / gist:f9e79c30859441541d54
Created August 19, 2015 10:56
GalenTestBase -- Load AndroidDriver
package com.galenframework.java.sample.components;
import static java.util.Arrays.asList;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.List;
import org.openqa.selenium.Dimension;
import org.openqa.selenium.WebDriver;
[TestNG] Running:
/private/var/folders/wd/9s7s80fd66j88vf5119rwt300000gp/T/testng-eclipse-1475842932/testng-customsuite.xml
[main] ERROR com.galenframework.api.Galen - Error during setting screenshot.
java.lang.RuntimeException: Error making screenshot
at com.galenframework.browser.SeleniumBrowser.createScreenshot(SeleniumBrowser.java:96)
at com.galenframework.page.selenium.SeleniumPage.createScreenshot(SeleniumPage.java:171)
at com.galenframework.api.Galen.checkLayoutForPage(Galen.java:97)
at com.galenframework.api.Galen.checkLayout(Galen.java:83)
at com.galenframework.api.Galen.checkLayout(Galen.java:67)
@saikrishna321
saikrishna321 / gist:e65ccc0f3828b91cc9fd
Created September 23, 2015 11:14
appium_ios_simulator_crashes
info: --> POST /wd/hub/session {"desiredCapabilities":{"app":"/Users/saikrisv/git/VodQa_MobileAutomationWorkShop/VodQA_WorkShop/build/TestApp.app.zip","platformName":"iOS","deviceName":"iPhone 5s","platformVersion":"9.0"}}
info: Client User-Agent string: Apache-HttpClient/4.3.3 (java 1.5)
info: [debug] Using local .zip from desired caps: /Users/saikrisv/git/VodQa_MobileAutomationWorkShop/VodQA_WorkShop/build/TestApp.app.zip
info: [debug] Copying local zip to tmp dir
info: [debug] /Users/saikrisv/git/VodQa_MobileAutomationWorkShop/VodQA_WorkShop/build/TestApp.app.zip copied to /var/folders/wd/9s7s80fd66j88vf5119rwt300000gp/T/115823-10614-wmfiz3/appium-app.zip
info: [debug] Unzipping /var/folders/wd/9s7s80fd66j88vf5119rwt300000gp/T/115823-10614-wmfiz3/appium-app.zip
info: [debug] Testing zip archive: /var/folders/wd/9s7s80fd66j88vf5119rwt300000gp/T/115823-10614-wmfiz3/appium-app.zip
info: [debug] Zip archive tested clean
info: [debug] Unzip successful
info: [debug] Using locally extracted app: /var/folders/wd/9
task debugAppiumTest {
def protocol = "https://"
def localIp = obtainCurrentIpAddress()
def port = "8443"
def backendAddress = protocol + localIp + ":" + port + "/"
File valuesFile = file("/Users/saikrisv/git/iot/KanJuice/app/src/main/res/values/strings.xml")
if (valuesFile.exists()) {
String content = valuesFile.getText('UTF-8')
String replaceContent = "<string name=\"connection\"></string>"
StringBuilder sys_ip = new StringBuilder(replaceContent);
[TestNG] Running:
Command line suite
Before ClassesCommand line hello world. Thread id = pool-1-thread-2
Before ClassesCommand line hello world. Thread id = pool-1-thread-1
BeforeMethod Command line hello world. Thread id = pool-1-thread-1
BeforeMethod Command line hello world. Thread id = pool-1-thread-2
*****threadcount***0
Starting Appium Server
192.168.56.101:5555
[TestNG] Running:
Command line suite
Before ClassesCommand line hello world. Thread id = pool-1-thread-1
BeforeMethod Command line hello world. Thread id = pool-1-thread-2
BeforeMethod Command line hello world. Thread id = pool-1-thread-1
*****threadcount***0
*****threadcount***1
Starting Appium Server
192.168.56.101:5555
[INFO] Building java-client 3.3.1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ java-client ---
[INFO] Deleting /Users/saikrisv/git/java-client/target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ java-client ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 2 resources
[INFO]
...
... TestNG 6.9.10 by Cédric Beust (cedric@beust.com)
...
[TestRunner] Running the tests in 'Test' with parallel mode:methods
[RunInfo] Adding method selector: org.testng.internal.XmlMethodSelector@47fd17e3 priority: 10
[TestClass] Creating TestClass for [ClassImpl class=com.test.classes.TestNGMethodSelector]
[TestClass] Adding method TestNGMethodSelector.methodThree()[pri:0, instance:null] on TestClass class com.test.classes.TestNGMethodSelector
[TestClass] Adding method TestNGMethodSelector.methodFive()[pri:0, instance:null] on TestClass class com.test.classes.TestNGMethodSelector
[TestClass] Adding method TestNGMethodSelector.methodSeven()[pri:0, instance:null] on TestClass class com.test.classes.TestNGMethodSelector
~/Documents/workspace/TestNGParallel (ios_fix ✘)✹✭ ᐅ mvn clean -Dtest=Runner test
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building TestDistribution 2.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ TestDistribution ---
[INFO] Deleting /Users/saikrisv/Documents/workspace/TestNGParallel/target
[INFO]