简体   繁体   中英

Robotium and Jenkins UI testing errors

I first ran into this problem when trying to run Robotium UI tests on a MacOS Mini with no monitor. I added Robotium code to test UI clicks on screen, since we want to add some UI automation to our regression testing. The error I get on the Jenkins server is when solo.clickInList(X) is run:

junit.framework.AssertionFailedError: AbsListView is not found!
     [exec]     at com.jayway.android.robotium.solo.Waiter.waitForAndGetView(Waiter.java:492)
     [exec]     at com.jayway.android.robotium.solo.Clicker.clickInList(Clicker.java:406)
     [exec]     at com.jayway.android.robotium.solo.Clicker.clickInList(Clicker.java:388)
     [exec]     at com.jayway.android.robotium.solo.Solo.clickInList(Solo.java:1081)
     [exec]     at com.cars.android.robotium.TestApplication.testSearch(TestApplication.java:29)

I found out that Jenkins needs Xvnc plugin to fake a UI so that the emulator can use it. Make sure to check "Show emulator window" in the specific job. Now doing that I currently get this error.

/Applications/RealVNC/VNC\ Server.app :$DISPLAY_NUMBER -localhost -geometry 1280x1024 -depth 24 -SecurityTypes None

I now get this error in Jenkins

Starting xvnc
[workspace] $ "/Applications/RealVNC/VNC Viewer.app" :77 -localhost -geometry 1280x1024 -depth 24 -SecurityTypes None
FATAL: Cannot run program "/Applications/RealVNC/VNC Viewer.app" (in directory "/Users/Shared/Jenkins/Home/jobs/Android/workspace"): error=13, Permission denied
java.io.IOException: Cannot run program "/Applications/RealVNC/VNC Viewer.app" (in directory "/Users/Shared/Jenkins/Home/jobs/Android/workspace"): error=13, Permission denied

You don't say whether the Robotium tests work on your local machine, so I don't know whether the Robotium code itself is correct.

But regarding the Xvnc setup, I see a couple of probable issues:

  1. "VNC Viewer.app" sounds like a VNC client , rather than an X11 server .

  2. As far as I know, you can't just run "/Applications/Foo.app" on the command line. You usually need to run the actual binary; something like "/Applications/Foo.app/Contents/MacOS/foo".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM