Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Jubula » Change AUT Config Path before executing test
Change AUT Config Path before executing test [message #1393503] Thu, 03 July 2014 22:39 Go to next message
Fernando Gomes is currently offline Fernando GomesFriend
Messages: 11
Registered: July 2014
Junior Member
Is it possible to change the AUT executable path, in the AUT config before running a test?

For example, I'm testing one installer, and after running the installer I would need to run the uninstaler, but the uninstaller path will depend on the path you supplied to the installer. <-This means, it will vary, I can't have a static AUT Config for this.

So, is there a way of changing the AUT Config of the Uninstaller Test Project, just before running it?

Thanks ind Advance.
Re: Change AUT Config Path before executing test [message #1393689 is a reply to message #1393503] Fri, 04 July 2014 05:51 Go to previous messageGo to next message
Alexandra Schladebeck is currently offline Alexandra SchladebeckFriend
Messages: 1270
Registered: July 2009
Senior Member
Hi,

I can't think of a way I know right now, but I'll ask.

Best regards,
Alex
Re: Change AUT Config Path before executing test [message #1393725 is a reply to message #1393689] Fri, 04 July 2014 07:14 Go to previous messageGo to next message
Alexandra Schladebeck is currently offline Alexandra SchladebeckFriend
Messages: 1270
Registered: July 2009
Senior Member
Hi,

I asked, and the suggestion is to start your AUT via a script that can read an environment variable. Then you can set the environment variable to be the flexible part of your path.

Hope that helps!
Alex
Re: Change AUT Config Path before executing test [message #1395916 is a reply to message #1393725] Mon, 07 July 2014 15:44 Go to previous messageGo to next message
Fernando Gomes is currently offline Fernando GomesFriend
Messages: 11
Registered: July 2014
Junior Member
Thanks for looking into that Alex, I'll see what I can do with the script approach


Edit: I got another question,

I have a program that changes its behaviour depending if it can find certain files(or environmental variables) in the system, so if it finds these files it send you to a determined screen, if it doesn.t it sends you to another screen.

Is there a way to check in the Jubula test if a file/variable exist in order to choose which testsuite to use?

Edit2: Also, is it possible to choose a variable depending on the OS I have running in the machine?

[Updated on: Mon, 07 July 2014 16:22]

Report message to a moderator

Re: Change AUT Config Path before executing test [message #1395960 is a reply to message #1395916] Mon, 07 July 2014 17:13 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 523
Registered: July 2009
Senior Member
For the AUT config path, you can also modify the database directly (quite easy if you're already using ANT to launch tests) :
update aut_conf_attr
set attr_value = 'XXXX'
where attr_key = 'WORKING_DIR';
update aut_conf_attr
set attr_value = 'XXXXX\\YYYY.exe'
where attr_key = 'EXECUTABLE';

you may want to add more conditions in the where clauses in order to be sure to modify only the project you really want to modify.
Re: Change AUT Config Path before executing test [message #1397518 is a reply to message #1395960] Wed, 09 July 2014 21:05 Go to previous messageGo to next message
Fernando Gomes is currently offline Fernando GomesFriend
Messages: 11
Registered: July 2014
Junior Member
Thanks, I'll look into that
Re: Change AUT Config Path before executing test [message #1397531 is a reply to message #1397518] Wed, 09 July 2014 21:31 Go to previous messageGo to next message
David Hickernell is currently offline David HickernellFriend
Messages: 82
Registered: October 2012
Member
For checking whether a file or variable exists, you can execute a script as an external command and check its return value.
Re: Change AUT Config Path before executing test [message #1397576 is a reply to message #1397531] Wed, 09 July 2014 23:08 Go to previous messageGo to next message
Fernando Gomes is currently offline Fernando GomesFriend
Messages: 11
Registered: July 2014
Junior Member
But can you use that return value to 'branch' your testing?(go through a different flow than what you would normally do?)

Thanks in Advance

Fernando
Re: Change AUT Config Path before executing test [message #1397592 is a reply to message #1397576] Wed, 09 July 2014 23:44 Go to previous message
David Hickernell is currently offline David HickernellFriend
Messages: 82
Registered: October 2012
Member
You can use an event handler to do that; however, if the script's exit code does not match your expected value, then the test case that calls the script will still show up as a failure.

You might be able to get around this by storing your command in a variable, using the value of that variable as your COMMAND parameter, and then (in the event handler) overwriting the variable with a command that will always return your expected value. Then you can give the event handler a reentry type of RETRY, and the test case should pass after the event handler executes.
Previous Topic:Check If a Gigantic Mult Line Text Matches
Next Topic:JavaFX
Goto Forum:
  


Current Time: Fri Mar 06 11:07:52 GMT 2015

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

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