Can we run Java Swing tests from iTestRT on a LInux machine with no display set up?
Attachments: Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.
No. Maybe you can forward the Display to another machine?
Chris posted this originally for me, so I'll ask some follow up questions now that I've had a chance to play with it.
I've been able to get some swing tests running headlessly in Xvfb and XVnc using itestcli and the -g option. On both occasions, I set the display variable to be the virtual desktop's server instance prepended on the command line. Something like this:
DISPLAY=:1.0 itestcli -g -w /opt/etf_workspace/ project://my_project/test_cases/SwingSetTabCapture.fftc
This worked fine. Now there's two questions I have:
Can iTestRT run gui apps headlessly by forwarding the display to this virtual server, AND if not, does the -g flag on itestcli burn up a developer license if it's being run on an execution box with an execution license? Ultimately that's the goal, to run these regression tests on the execution servers that have the unlimited execution licenses, instead of burning up developer licenses to run the regressions.
Does iTestRT have the capability to run Swing automation tests, even if they're not headless? I'm doing this (on my desktop, without messing with the DISPLAY env variable):
itestrt --itar file:/opt/ --test project://my_project/test_cases/SwingSetTabCapture.fftc
And getting this:
Fail session ma t2 1 1 main The application "com.fnfr.svt.applications.java.swing" is unknown
With 4.0.2 it won't work.
Swing support for iTestRT will be available soon. It is not supported at the moment
I know this might not get an answer, but what will it look like? Does this mean that I can forward it's display to a vncserver or xvfb instance? If so, then we've solved the problem I have.
Yes you will be able to forward the display. You wont need to pass it -g option either.
So for the sake of future reference, I figured I'd put a few notes here for when that support does arrive:
If you're unfamiliar with exporting a display in Xwindows, you might want to go read up on it elsewhere, as it's far too much for me to dig into in a forum post (and i'm likely to get stuff wrong). XWindow Design is a good start for understanding some of the basics, but really you aught to look it up in Google using the keywords of "how to export X DISPLAY".
Headless test execution of a java swing application on a Linux box relies on a few predicates:
After you start up the virtual server, you'll either specify a display number or you'll have received one if you didn't. This is the number you'll pass on to iTestRT/itestcli via the DISPLAY environment variable. All you need to do is specify it before you run the itestcli/iTestRT command:
DISPLAY=:2.0 itestcli -g -w <workspace> <testcase>
In this example, the display we wished to export to was "2", and it's specified by ":2.0". The ".0" specifies the screen, but since this is a virtual framebuffer, you usually only have one screen.
This is all I needed to get itestcli running in a Xvnc server doing some automation on my Swing GUI. Hopefully this is helpful for others.
Thanks for posting this info tlawall
It would be useful for anyone else trying to set up their displays.
No one has followed this question yet.
Restart Inactive session not works in iTest 3.4.2
Combining web and Swing sessions
Snapshot image size
Native Java Swing Capture?
VNC session for iphone 4