Unable to launch appium programatically on mac due to missing file appium.js in "Appium.app/Contents/Resources/node_modules/appium/bin/"


#1

Appium 1.5.3
I am trying to launch appium programatically on Mac using Appium Support, however it is failing with error - “com.github.genium_framework.server.exception.InvalidAppiumJSFilePathException: The file you provided was not found on your HDD. You provided the following file path: /Applications/Appium.app/Contents/Resources/node_modules/appium/bin/appium.js”

I have checked and found that appium.js does not exist in …/bin folder. It doesn’t exist in any other folder either.

The same is working fine on my Windows computer, Appium version 1.4.16.1 because appium.js exists in bin folder in Windows.

Any ideas why it is missing from Mac?
Thanks.


Can't find main.js /appium folder
#2

I am facing the same issue. Not sure why appium.js file is missing in folder /Applications/Appium.app/Contents/Resources/node_modules/appium/bin/

Appium 1.5.3


#3

Same here I am facing same problem with 1.5.3


#4

@Loveleen @maheshmore77 You need to use /Applications/Appium.app/Contents/Resources/node_modules/appium/lib/main.js instead of appium.js


#5

I just tried this and it worked:

/Applications/Appium.app/Contents/Resources/node_modules/appium/build/lib/main.js


#6

build/lib/main.js sounds correct. Appium 1.5 was a major refactor of Appium, so some of the more familiar files you’d expect from the Appium 1.4 series and earlier might not exist anymore. A lot of files are “transpiled” using Babel, so there is a build/ directory for the Javascript files. You want node to run the files under the build/ directories. The original source code uses new features of Javascript that have not yet been implemented in the Node interpreter.


#7

i have the same problem with following configuration:

ServerArguments serverArguments = new ServerArguments();
serverArguments.setArgument("–address", “127.0.0.1”);
serverArguments.setArgument("–no-reset", true);
serverArguments.setArgument("–local-timezone", true);

	AppiumServer _appiumServer = new AppiumServer(new File("/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/main.js"),serverArguments);
	//AppiumServer _appiumServer = new AppiumServer(serverArguments);
	_appiumServer.startServer();

Appium-Version 1.5.3

Can someone help me please. Thanks!

Error:
com.github.genium_framework.server.exception.InvalidNodeFilePathException: The file you provided was not found on your HDD. You provided the following file path: /Applications/Appium.app/Contents/Resources/node_modules/appium/lib/main.js/node/bin/node
at com.github.genium_framework.appium.support.server.AppiumServer.startServer(AppiumServer.java:261)
at com.github.genium_framework.appium.support.server.AppiumServer.startServer(AppiumServer.java:245)
at UMD.Android_01_UMD.setUp(Android_01_UMD.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

java.lang.NullPointerException
at UMD.Android_01_UMD.tearDown(Android_01_UMD.java:80)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:33)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)


#8

@David As I have already mentioned above, in my case it worked with this path - /Applications/Appium.app/Contents/Resources/node_modules/appium/build/lib/main.js

You can try it and see if it works.


#9

I changed it as you mentioned but I still got following error:

Do you have any other idea? Thanks…

com.github.genium_framework.server.exception.InvalidNodeFilePathException: The file you provided was not found on your HDD. You provided the following file path: /Applications/Appium.app/Contents/Resources/node_modules/appium/build/lib/main.js/node/bin/node
at com.github.genium_framework.appium.support.server.AppiumServer.startServer(AppiumServer.java:261)
at com.github.genium_framework.appium.support.server.AppiumServer.startServer(AppiumServer.java:245)
at UMD.Android_01_UMD.setUp(Android_01_UMD.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

java.lang.NullPointerException
at UMD.Android_01_UMD.tearDown(Android_01_UMD.java:80)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:33)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)


#10

It appears like you have provided wrong arguments to the AppiumServer class constructor.

Try this:
AppiumServer _appiumServer = new AppiumServer(new File("/node_Executable_File_Path"), new File("/appium_JavaScript_File_Path"), serverArguments);

For example:
AppiumServer _appiumServer = new AppiumServer(new File("/Applications/Appium.app/Contents/Resources/node/bin/node"), new File("/Applications/Appium.app/Contents/Resources/node_modules/appium/build/lib/main.js"), serverArguments);

More information here: https://github.com/Genium-Framework/Appium-Support/wiki


#11

Many thanks… it works… :slight_smile:
:clap: