Skip to content

Commit ff0b406

Browse files
Shanoj ThekkanShanoj Thekkan
authored andcommitted
Modified test
1 parent e0161f9 commit ff0b406

File tree

1 file changed

+8
-6
lines changed
  • Test_proj/src/test/java/com/testing/proj/Test_proj

1 file changed

+8
-6
lines changed

Test_proj/src/test/java/com/testing/proj/Test_proj/AppTest.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public class AppTest
4444
// public static void setup(String pVer, String pName, String appLocation, String dName)
4545
public static void setup() throws IOException {
4646

47-
Runtime.getRuntime().exec("/bin/bash export ANDROID_HOME=/Users/shanojthekkan/Library/Android/sdk/");
47+
/*Runtime.getRuntime().exec("/bin/bash export ANDROID_HOME=/Users/shanojthekkan/Library/Android/sdk/");
4848
4949
CommandLine command = new CommandLine("/usr/local/bin/node");
5050
command.addArgument("/Applications/Appium.app/Contents/Resources/app/node_modules/appium/build/lib/main.js", false);
@@ -58,10 +58,10 @@ public static void setup() throws IOException {
5858
executor.setExitValue(1);
5959
executor.execute(command, resultHandler);
6060
61-
61+
*/
6262

63-
// stopAppiumServer();
64-
// startAppiumServer();
63+
stopAppiumServer();
64+
startAppiumServer();
6565

6666
File appDir = new File("resources");
6767
File app = new File(appDir, "Officeworks.apk");
@@ -88,10 +88,12 @@ public static void startAppiumServer() throws IOException {
8888

8989
System.out.println("Starting Appium Server ......");
9090

91-
91+
Map<String, String> env = new HashMap<String, String>();
92+
env.put("ANDROID_HOME","/Users/shanojthekkan/Library/Android/sdk");
93+
env.put("JAVA_HOME","/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home");
9294

9395
service = AppiumDriverLocalService.buildService(new AppiumServiceBuilder().usingDriverExecutable(new File(AppiumNodeFilePath)).withAppiumJS(
94-
new File(AppiumJavaScriptServerFile)));
96+
new File(AppiumJavaScriptServerFile)).withEnvironment(env));
9597

9698
service.start();
9799

0 commit comments

Comments
 (0)