Open HoLeAnh opened 5 years ago
io.appium.java_client.service.local.InvalidServerInstanceException: Invalid server instance exception has occured: The invalid appium node
You need to set the node in PATH or you can point the 'AppiumDriverLocalService' to appium main.js
io.appium.java_client.service.local.InvalidServerInstanceException: Invalid server instance exception has occured: The invalid appium node
You need to set the node in PATH or you can point the 'AppiumDriverLocalService' to appium main.js
I have added main.js path on my code but Jenkin not understand it, you can guide me or give me some code reference.
private static final String APPIUM_JS_PATH = System.getenv("AppData") + "/npm/node_modules/appium/build/lib/main.js"; builder.withAppiumJS(new File(APPIUM_JS_PATH));
@HoLeAnh Did you find the solution?
Description
I can start AppiumDriverLocalService in local but when run on Jenkin, i receive a error : io.appium.java_client.service.local.InvalidServerInstanceException: Invalid server instance exception has occured: The invalid appium node C:\windows\system32\config\systemprofile\AppData\Roaming\npm\node_modules\appium\build\lib\main.js has been defined Caused by: java.io.IOException: The node C:\windows\system32\config\systemprofile\AppData\Roaming\npm\node_modules\appium\build\lib\main.jsdoesn't exist
Environment
Appium : 1.8.1 Java client : 5.0.4
Details
Please provide more details, if necessary.
Code To Reproduce Issue [ Good To Have ]
private static final String NODE_JS_PATH = "C:/Program Files/nodejs/node.exe"; private static final String APPIUM_JS_PATH = System.getenv("AppData") + "/npm/node_modules/appium/build/lib/main.js";
Link to Appium logs
Started by timer Running as SYSTEM Building in workspace D:\Workspace\maven_appium [maven_appium] $ cmd /c call C:\windows\TEMP\jenkins1643235431572429234.bat
D:\Workspace\maven_appium>mvn clean test -DsuiteXmlFiles=runSuites/AllRun.xml [INFO] Scanning for projects... [INFO] [INFO] ---------------------< Maven_Appium:Maven_Appium >---------------------- [INFO] Building Maven_Appium 0.0.1-SNAPSHOT [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ Maven_Appium --- [INFO] Deleting D:\Workspace\maven_appium\target [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ Maven_Appium --- [WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory D:\Workspace\maven_appium\src\main\resources [INFO] [INFO] --- maven-compiler-plugin:3.6.0:compile (default-compile) @ Maven_Appium --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 63 source files to D:\Workspace\maven_appium\target\classes [INFO] /D:/Workspace/maven_appium/src/main/java/actions/APIClass/SellerWeb_Changestock.java: D:\Workspace\maven_appium\src\main\java\actions\APIClass\SellerWeb_Changestock.java uses or overrides a deprecated API. [INFO] /D:/Workspace/maven_appium/src/main/java/actions/APIClass/SellerWeb_Changestock.java: Recompile with -Xlint:deprecation for details. [INFO] /D:/Workspace/maven_appium/src/main/java/actions/ScreenRecord.java: Some input files use unchecked or unsafe operations. [INFO] /D:/Workspace/maven_appium/src/main/java/actions/ScreenRecord.java: Recompile with -Xlint:unchecked for details. [INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ Maven_Appium --- [WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory D:\Workspace\maven_appium\src\test\resources [INFO] [INFO] --- maven-compiler-plugin:3.6.0:testCompile (default-testCompile) @ Maven_Appium --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 20 source files to D:\Workspace\maven_appium\target\test-classes [INFO] [INFO] --- maven-surefire-plugin:2.20:test (default-test) @ Maven_Appium --- [INFO] [INFO] ------------------------------------------------------- [INFO] T E S T S [INFO] ------------------------------------------------------- [WARNING] Corrupted stdin stream in forked JVM 1. See the dump file D:\Workspace\maven_appium\target\surefire-reports\2019-08-30T03-08-35_575-jvmRun1.dumpstream [INFO] Running TestSuite [TestNGContentHandler] [WARN] It is strongly recommended to add "<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >" at the top of your file, otherwise TestNG may fail or not work as expected. [TestNG] [WARN] AnnotationTransformer already set ... ... TestNG 6.10 by Cédric Beust (cedric@beust.com) ...
Success to connect database before deviceMapping : {192.168.106.101:5555=true}-13 after deviceMapping : {192.168.106.101:5555=false}-13 [ERROR] Tests run: 313, Failures: 1, Errors: 0, Skipped: 312, Time elapsed: 3.096 s <<< FAILURE! - in TestSuite [ERROR] BeforeClass(chat.Chat) Time elapsed: 2.264 s <<< FAILURE! io.appium.java_client.service.local.InvalidServerInstanceException: Invalid server instance exception has occured: The invalid appium node C:\windows\system32\config\systemprofile\AppData\Roaming\npm\node_modules\appium\build\lib\main.js has been defined Caused by: java.io.IOException: The node C:\windows\system32\config\systemprofile\AppData\Roaming\npm\node_modules\appium\build\lib\main.jsdoesn't exist
[INFO] [INFO] Results: [INFO] [ERROR] Failures: [ERROR] Chat>Testbase.BeforeClass:78 » InvalidServerInstance Invalid server instance e... [INFO] [ERROR] Tests run: 155, Failures: 1, Errors: 0, Skipped: 154 [INFO] [ERROR] There are test failures.
Please refer to D:\Workspace\maven_appium\target\surefire-reports for the individual test results. Please refer to dump files (if any exist) [date]-jvmRun[N].dump, [date].dumpstream and [date]-jvmRun[N].dumpstream. [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 32.731 s [INFO] Finished at: 2019-08-30T03:08:40+07:00 [INFO] ------------------------------------------------------------------------ TestNG Reports Processing: START Looking for TestNG results report in workspace using pattern: **/testng-results.xml Saving reports... Processing 'C:\Program Files (x86)\Jenkins\jobs\Seller _Appium\builds\278\testng\testng-results.xml' TestNG Reports Processing: FINISH Finished: SUCCESS