Skip to content

Instantly share code, notes, and snippets.

View sahajamit's full-sized avatar

Amit Rawat sahajamit

View GitHub Profile
android list targets
android create avd -n <name> -t <targetID> [-<option> <value>] ...
android delete avd -n <name>
To Launch the avd
emulator -avd <name> - to launch the avd
android avd - to launch the avd manager
To know the package name and main activity of an apk:
cd /Users/amit.rawat/Library/Android/sdk/build-tools/21.1.2
./aapt dump badging <Path of apk>
Look for text "package" in the output
Look for text "launchable-activity:
package: name='io.appium.android.apis' versionCode='' versionName='' platformBuildVersionName=''
launchable-activity: name='io.appium.android.apis.ApiDemos' label='' icon=''
@sahajamit
sahajamit / CaptureBrowserScreenShot.java
Created October 8, 2015 14:28
This code will help you to take the screenshot of the complete scrollable page.
package com.mobile.equinox.util;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.imageio.ImageIO;
[
{
"id": "feature1",
"description": "This is the description for Feature1",
"name": "Feature1",
"keyword": "Feature",
"line": 1,
"elements": [
{
"after": [
import java.util.HashMap;
import java.util.Map;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.remote.DesiredCapabilities;
public class MobileEmulation {
package com.cucumber.testng.examples;
import cucumber.api.CucumberOptions;
import cucumber.api.testng.AbstractTestNGCucumberTests;
/**
* Created by Amit Rawat on 2/23/2016.
*/
@CucumberOptions(features = "src/test/resources/com.cucumber.testng.examples/date_calculator1.feature", format = { "pretty",
"html:target/site/cucumber-pretty",
"json:target/cucumber1.json" })
@sahajamit
sahajamit / RunCukesByCompositionGrp1_Test2.java
Created February 23, 2016 08:44
RunCukesByCompositionGrp1_Test2
@CucumberOptions(features = "src/test/resources/com.cucumber.testng.examples/date_calculator1.feature",
plugin = "json:target/cucumber2.json")
public class RunCukesByCompositionGrp1_Test2 {
@Test(groups = "examples-testng", description = "Example of using TestNGCucumberRunner to invoke Cucumber")
public void runCukes() {
new TestNGCucumberRunner(getClass()).runCukes();
}
}
Add the following code in the POM.xml
<repository>
<id>in-project</id>
<name>In Project Repo</name>
<url>file://${project.basedir}/libs</url>
</repository>
http://www.mkyong.com/maven/how-to-include-library-manully-into-maven-local-repository/
List<String> results = JsonPath.read(jsonArrayResultSet.toString(), "$[*].tradeId");
results = ImmutableSet.copyOf(results).asList();
@sahajamit
sahajamit / HTMLTableBuilder.java
Created June 14, 2016 03:02 — forked from 2sbsbsb/HTMLTableBuilder.java
Simple HTML Table Builder
/**
* Uses:
* HTMLTableBuilder htmlBuilder = new HTMLTableBuilder(null, true, 2, 3);
* htmlBuilder.addTableHeader("1H", "2H", "3H");
* htmlBuilder.addRowValues("1", "2", "3");
* htmlBuilder.addRowValues("4", "5", "6");
* htmlBuilder.addRowValues("9", "8", "7");
* String table = htmlBuilder.build();
* System.out.println(table.toString());
*/