|
Re: Names in repeatable automated tests [message #1795195 is a reply to message #1794941] |
Tue, 18 September 2018 08:46 |
Jens Lidestrom Messages: 11 Registered: April 2017 Location: Göteborg, Sweden |
Junior Member |
|
|
First I have to say that it doesn't sound like a good idea to change the values that are used in the test depending on what time it is run. If the tests are to be fully repeatable they should run in exactly the same way every time.
That being said, maybe the following can solve your problem:
- Get the time from some source that is external to the test script. From the POM in Maven, or maybe from a workbench variable in Eclipse.
- Set a system property in the command line of the AUT, using the -D flag. For example -DtestTime=TIME_IN_RIGHT_FORMAT.
- In the test script, get the value with substitute-variables "${system_property:testTime}"
You can probably get the time into the AUT by adding the following to the Program Arguments in the AUT launch configuration in Eclipse:
-DtestTime=${current_date:SOME_FORMAT}
(${current_date:ARG} is a Workbench variable in Eclipse, which gets the time and formats in depending on the Java SimpleDateFormat string. They are often very useful!)
Information about this way of getting a value into the AUT can be found here:
https://www.eclipse.org/rcptt/documentation/faq/pass-value/
[Updated on: Tue, 18 September 2018 19:16] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.05430 seconds