Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Jubula » How to set AUT Arguments using Testexec?
How to set AUT Arguments using Testexec? [message #953809] Mon, 22 October 2012 14:53 Go to next message
Vadim Stark is currently offline Vadim StarkFriend
Messages: 3
Registered: October 2012
Junior Member
Hi everyone,

In AUT Configurations, on Expert, there is a field called AUT Arguments where I need to enter different information every time I run the test.

I am using testexec command to test the AUT, and I couldn't find a way to set the AUT arguments programatically. I have tried including a %My_System_Variable% inside that field in Jubula, but seems like it didn't see it as a system variable.

From the documentation, it feels like the configuration file for testexec doesn't include such option either.

Any help is greatly appreciated.
Thanks in advance,

Vadim Stark
Re: How to set AUT Arguments using Testexec? [message #954849 is a reply to message #953809] Tue, 23 October 2012 09:48 Go to previous messageGo to next message
Alexandra Schladebeck is currently offline Alexandra SchladebeckFriend
Messages: 1613
Registered: July 2009
Senior Member
Hi,

What kind of information are you entering in the AUT arguments? Knowing what sort of things you are configuring might help to find the correct place / best way to configure them.

Alex
Re: How to set AUT Arguments using Testexec? [message #954966 is a reply to message #954849] Tue, 23 October 2012 11:52 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
For example the -data for a RCP, how can this be configured ?
Re: How to set AUT Arguments using Testexec? [message #955163 is a reply to message #953809] Tue, 23 October 2012 15:13 Go to previous messageGo to next message
Vadim Stark is currently offline Vadim StarkFriend
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 #956148 is a reply to message #955163] Wed, 24 October 2012 09:22 Go to previous messageGo to next message
Alexandra Schladebeck is currently offline Alexandra SchladebeckFriend
Messages: 1613
Registered: July 2009
Senior Member
Sylvain - the -data should be entered in the AUT Arguments section.
Vadim - if there's a finite amount of configurations, my first suggestion would be to write separate AUT configurations for them. That also makes your configurations deterministic - i.e. you should be able to repeat a test with exactly the same configuration and get the correct results. I'll check for any other ideas though to configure such things more dynamically.
Re: How to set AUT Arguments using Testexec? [message #956181 is a reply to message #956148] Wed, 24 October 2012 09:53 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
I was asking in the scope of testexec.
I added the -data argument in the testexec command but it wasn't taken into account.
Re: How to set AUT Arguments using Testexec? [message #956272 is a reply to message #956181] Wed, 24 October 2012 11:25 Go to previous messageGo to next message
Alexandra Schladebeck is currently offline Alexandra SchladebeckFriend
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 #956309 is a reply to message #956272] Wed, 24 October 2012 12:04 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
Ok, so it's been reported. Thanks for the fix.
Re: How to set AUT Arguments using Testexec? [message #956821 is a reply to message #953809] Wed, 24 October 2012 20:46 Go to previous message
Vadim Stark is currently offline Vadim StarkFriend
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
Previous Topic:New versions of Jubula and GUIdancer
Next Topic:No project with name and version in database - dburl
Goto Forum:
  


Current Time: Sun Oct 06 20:07:00 GMT 2024

Powered by FUDForum. Page generated in 0.04266 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top