|
|
|
Re: How to set AUT Arguments using Testexec? [message #955163 is a reply to message #953809] |
Tue, 23 October 2012 15:13 |
Vadim Stark Messages: 3 Registered: October 2012 |
Junior Member |
|
|
Hi Alex,
Thanks for the quick reply.
The AUT I am working with is just a container, by itself it does nothing, it needs arguments to know what to configure, and will display completely different information every time it loads based on them. To clarify, I'm in Windows environment, and the AUT is using Swing.
The AUT is run from a bat file like this:
"somepath\javaw" -classpath "C:\somepath2\file1.jar";"C:\somepath3\file2.jar" somepackage.Main --file "somepath4" --other arguments
I couldn't connect Jubula to the AUT by specifying this bat file, so instead I went to AUT Configurations on Expert and specified those 3 things: Classpath, Main Class Name, and AUT Arguments to get it working. I need to automate this process, since this AUT will be tested many times using different arguments. I am using testexec, and need to find a way/workaround to enter the AUT Arguments programatically.
Is there a way to perhaps place system variables in that field such that they get resolved at AUT startup? (like %somepath%) Or any other way?
Thanks in advance,
Vadim Stark
|
|
|
|
|
Re: How to set AUT Arguments using Testexec? [message #956272 is a reply to message #956181] |
Wed, 24 October 2012 11:25 |
Alexandra Schladebeck Messages: 1613 Registered: July 2009 |
Senior Member |
|
|
Hi,
Vadim - I chatted to the developers and they suggested that if you can get the .bat file working (and it should work for Java 1.5+), then you should be able to make use of environment variables specified in the environment of the AUT Agent. We've not tried this out, but the AUT process should inherit the variables from the AUT Agent's environment. So maybe it is worth spending some more time on the bat file - like I say, this should work. Nevertheless, my first suggestion of having specific, well-defined AUT configurations may make things easier in the long-run anyway.
Sylvain - if your testexec is using the parameter -autconfig, then you need to specify it in the configuration, as mentioned above. There's no need to enter it in the testexec (and it's also not possible). If you test different workspaces, then use different AUT configurations. If you're using autrun to start your AUT, then you'll need to write a small .cmd file that contains both the autrun commands and the -data, as described in this bug report.
HTH,
Alex
|
|
|
|
Re: How to set AUT Arguments using Testexec? [message #956821 is a reply to message #953809] |
Wed, 24 October 2012 20:46 |
Vadim Stark Messages: 3 Registered: October 2012 |
Junior Member |
|
|
Hi Alex,
Unfortunately the configurations aren't finite, moreover, a single configuration will only be tested once. (for example the user would choose an installation path, and I would then pass the path as an argument to the AUT).
I could not get this particular AUT working from the bat file. It loads up fine, but Jubula does not see it. (Loops on "Starting AUT with ID: ..") I've tried many ways of trying to get it to work, but so far the only one that worked was the one i described in previous posts (using Classpath, Main Class Name, and AUT Arguments in AUT Configurations on Expert). That way it connects to Jubula perfectly.
Since then, for testing purposes, instead of dealing with classpath, I merged all jar files into one, and added main class specification to the jar manifest. So now it's a matter of running a single jar file, like in Jubula examples for Swing.
The bat file has the following format:
"somepath1\javaw" -jar "somepath2\jarfile.jar" --arg1 val1 --arg2 val2 ... argn valn
Still Jubula doesn't pick up this AUT, even though it loads up fine. (Loops on Starting AUT). So it feels like doing it the other way with AUT Arguments is my only way out.
So I guess I have a few questions:
1) Is it possible to specify those AUT Arguments programatically somehow? Using a configuration file with testexec maybe?
2) If not, is it possible to modify the string that holds the contents from the AUT Arguments TextField inside some file where Jubula might store AUT Config information? (messy solution, but a solution nonetheless)
Thanks for your time,
Vadim Stark
|
|
|
Powered by
FUDForum. Page generated in 0.04266 seconds