Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sample fix #1

Merged
merged 2 commits into from
Jan 7, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,18 @@
<version>1.4.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
</plugins>
</build>
</project>
18 changes: 14 additions & 4 deletions src/test/java/com/test/classes/AppiumServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,33 @@ public void startDefaultAppium() throws Exception {
public void appiumServer(String deviceID) throws Exception {
System.out.println("Starting Appium Server");
System.out.println(deviceID);
System.out.println("Attempt to get port..");
int port = ap.getPort();
System.out.println("Port " + port);
System.out.println("Attempt to get chrome port..");
int chromePort = ap.getPort();
System.out.println("Chrome port " + chromePort);
System.out.println("Attempt to get bootstrap port..");
int bootstrapPort = ap.getPort();
System.out.println("Bootstrap port" + bootstrapPort);
Thread.currentThread().sleep(5000);

System.out.println("Attempt to start server");
builder = new AppiumServiceBuilder()
.withAppiumJS(new File("/usr/local/lib/node_modules/appium/bin/appium.js"))
.withArgument(GeneralServerFlag.APP,
"/Users/saikrisv/Documents/workspace/workspace1/AppiumTest/build/AndroidCalculator.apk")
//.withAppiumJS(new File("/usr/local/lib/node_modules/appium/bin/appium.js"))
//.withArgument(GeneralServerFlag.APP,
// "/Users/saikrisv/Documents/workspace/workspace1/AppiumTest/build/AndroidCalculator.apk")
.withArgument(GeneralServerFlag.LOG_LEVEL, "info")
.withArgument(GeneralServerFlag.UIID, deviceID)
.withArgument(GeneralServerFlag.CHROME_DRIVER_PORT, Integer.toString(chromePort))
.withArgument(AndroidServerFlag.BOOTSTRAP_PORT_NUMBER, Integer.toString(bootstrapPort))
.withArgument(GeneralServerFlag.SESSION_OVERRIDE).usingPort(port);
.withArgument(GeneralServerFlag.SESSION_OVERRIDE).usingPort(port).withLogFile(new File("Log" + Thread.currentThread().getName() +
Thread.currentThread().getId()));
/* and so on */;

appiumDriverLocalService = builder.build();
appiumDriverLocalService.start();
System.out.println("Server has been started");
//appiumDriverLocalService.getStdOut();

System.out.println(appiumDriverLocalService.isRunning());
Expand Down
2 changes: 1 addition & 1 deletion testng.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite thread-count="3" name="Suite" parallel=methods verbose="1">
<suite thread-count="2" name="Suite" parallel="methods" verbose="1">
<test name="Test">
<classes>
<class name="com.test.classes.TestNGMethodSelector">
Expand Down