Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » RCP Testing Tool » Names in repeatable automated tests
Names in repeatable automated tests [message #1794941] Tue, 11 September 2018 12:08 Go to next message
Granit Gecaj is currently offline Granit GecajFriend
Messages: 1
Registered: September 2018
Junior Member
Hi,
I am currently working on a way to make automated tests for a eclipse based project. The goal is to press play and the whole workflow should be done quickly. Here's the problem:

During the process there need to be several packages created. During each run of the whole test suit ALL these packages should have the same identical name. Also, when I restart the test suit 5 minutes later, the package names should not be the same like the run before.

My idea was to make a time stamp in a ECL script..
 proc "get-time-stamp" {
	get-time | format-time -format "yyyy-MM-dd-HH-mm-ss"
}

proc "get-name" {
	concat "" "Test" "_" [get-time-stamp]
}

global [val newPackageName [get-name]]


and use that variable in my Tests
with [get-window "create package"] {
    get-editbox -after [get-label "Please enter Package name"] | set-text $newPackageName
    get-button OK | click
}


This works but everytime a new package gets created, a new time stamp gets created and the package name is not the same anymore.

Is there a way to auto generate a package name which is the same through the whole test suit and changes when you restart the test suit?
Re: Names in repeatable automated tests [message #1795195 is a reply to message #1794941] Tue, 18 September 2018 08:46 Go to previous message
Jens Lidestrom is currently offline Jens LidestromFriend
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:

  1. 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.
  2. Set a system property in the command line of the AUT, using the -D flag. For example -DtestTime=TIME_IN_RIGHT_FORMAT.
  3. 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

Previous Topic:Verification of Browser DOM
Next Topic:RCPTT Support of Shared Configuration Area
Goto Forum:
  


Current Time: Fri May 03 23:24:37 GMT 2024

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

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

Back to the top