I try to execute jar web-application in Jenkins job and start Selenoid tests If i execute command "java -jar app.jar" in pipeline Jenkins - i get exception
2024-11-18 13:54:16,203 [main] [INFO] () [r.s.c.w.a.RemoteApplication]: Started RemoteApplication in 4.282 seconds (JVM running for 4.498) 2024-11-18 13:54:16,248 [main] [WARN] () [r.s.c.w.r.SimpleUrlBrowser]: Please open the following address in your browser: 2024-11-18 13:54:16,249 [main] [WARN] () [r.s.c.w.r.SimpleUrlBrowser]: http://localhost:20080 java.lang.Exception: No web browser found
and Jenkins job freezes endlessly, until I manually abort the build.
This is how I see the solution:
- curl jar from remote server
- execute jar by "java -jar app.jar"
- start Selenoid UI tests.
- stop the job
Is there any way to run jar bypassing this exception?
I try to execute jar web-application in Jenkins job and start Selenoid tests If i execute command "java -jar app.jar" in pipeline Jenkins - i get exception
2024-11-18 13:54:16,203 [main] [INFO] () [r.s.c.w.a.RemoteApplication]: Started RemoteApplication in 4.282 seconds (JVM running for 4.498) 2024-11-18 13:54:16,248 [main] [WARN] () [r.s.c.w.r.SimpleUrlBrowser]: Please open the following address in your browser: 2024-11-18 13:54:16,249 [main] [WARN] () [r.s.c.w.r.SimpleUrlBrowser]: http://localhost:20080 java.lang.Exception: No web browser found
and Jenkins job freezes endlessly, until I manually abort the build.
This is how I see the solution:
- curl jar from remote server
- execute jar by "java -jar app.jar"
- start Selenoid UI tests.
- stop the job
Is there any way to run jar bypassing this exception?
Share Improve this question asked Nov 18, 2024 at 12:50 rustCohlerustCohle 11 bronze badge1 Answer
Reset to default 0The Jenkins node where the job is running has no browsers installed, or if it does then Selenoid cannot find any.
Here's something we've done to run Selenide tests on Jenkins:
docker.image('selenium/standalone-chrome').withRun('-v /dev/shm:/dev/shm -p 4444:4444') { c ->
def selenideRemote = "http://0.0.0.0:4444/wd/hub"
sh "mvn test -Dselenide.headless=true -Dselenide.remote=${selenideRemote} -DscreenshotsEnabled=true"
}
The combination of the Docker image, which has the proper browser etc. installed, and the headless option should make it work.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745616877a4636287.html
评论列表(0条)