Forum Discussion
smartTest
15 years agoContributor
Omar, firstly many thanks for your reply.
However, as I mentioned, I am not a programmer and am therefore unable to code in Groovy or Java, I am simply a QA looking for ways to make tests repeatable in an agile environment. Unfortunately, the request messages I have to use are fixed and require only updates to attributes to gain the required response from an external (and very old) db.
In case anyone else is interested later, I now have a very simple piece of code which sets a property value containing the date for the next coming Sunday:
By changing the "Sun" element to another day (i.e. Mon) you can automatically grab the required date. As I am testing a booking system I needed a way of auto-updating request and booking dates as required during CI testing.
Hope I've helped someone else with this..........
However, as I mentioned, I am not a programmer and am therefore unable to code in Groovy or Java, I am simply a QA looking for ways to make tests repeatable in an agile environment. Unfortunately, the request messages I have to use are fixed and require only updates to attributes to gain the required response from an external (and very old) db.
In case anyone else is interested later, I now have a very simple piece of code which sets a property value containing the date for the next coming Sunday:
def nextDay = new Date()
for (i=1;i<8;i++)
{
nextDay = nextDay + 1
if (nextDay.format("E")=="Sun") break
}
log.info "Next Sunday is " + nextDay.toString()
testRunner.testCase.setPropertyValue("NextSunday", nextDay.format("yyyy-MM-dd") );
By changing the "Sun" element to another day (i.e. Mon) you can automatically grab the required date. As I am testing a booking system I needed a way of auto-updating request and booking dates as required during CI testing.
Hope I've helped someone else with this..........