Closed arunkumar-muthusamy closed 5 years ago
I solved it on my own. Providing the answer here for those land here from google search...
It seems in the appium java client, the default path for appium main.js
is /usr/local/lib/node_modules/appium/build/lib/main.js
. But in the appium-docker-android
container, it is located in /usr/lib/node_modules/appium/build/lib/main.js
.
So, to fix this. Initialize the AppiumServiceBuilder
with the path to appiumJs
. See the code example below,
AppiumServiceBuilder serviceBuilder = new AppiumServiceBuilder().withAppiumJS(new File("/usr/lib/node_modules/appium/build/lib/main.js"));
AppiumDriverLocalService appiumDriverLocalService = AppiumDriverLocalService.buildService(serviceBuilder);
This might a problem with docker image config. Java client tries to detect node modules root by executing bash -l get_path_to_default_node.sh
script, which internally executes npm root -g
command. So, if any of these commands does not return a correct result then it fails with the error above.
cc @budtmo
@mykola-mokhnach Thanks for the insight!
Hi,
I'm getting following exception while initializing the new driver
AndroidDriver<MobileElement> androidDriver = new AndroidDriver(new URL(deviceFarmUrl), capabilities);
Everything was working well until end of last month. We didn't change anything in our end (other than we had Jenkins upgrade recently). BTW, the containers are provisioned runtime by Jenkins on Kube.
I understand, It is not an appium issue. I'm posting this to get some help from community.
Please let me know if i'm missing anything
Error from Test:
Inside the Container: