how to increment date for each test run
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
how to increment date for each test run
Hi,
In my test step I need to pass new date in each test run. How can I do that?
Regards,
Preeti
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In that case, the code which I have shared should work fine, considering that you can control the limit of the execution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Nancy2 ,
In your test case, place below a Groovy Script test step before the Request test step, so that it can generate the next date and also remembers the same for next time not to generate the duplicate date.
And in the request, use <element>${#TestCase#NEW_DATE}</element>
Here is the text of the above script
https://github.com/nmrao/soapUIGroovyScripts/blob/master/groovy/date/CreateNewDate.groovy
Doesn't require any additional libraries.
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Sorry for the delayed response.
I hope this solution will work. As of now I am facing issue while implementing this. I have done below steps -
1. In the test step example "Register TestCase"
2. Click on Insert Step > Groovy script and named as "NDate"
3. Copied the script given
4. Within "Register TestCase", For Date input parameter, added - ${#Register TestCase#NDate}
5. Ran Groovy script
6. Ran Register
At this time, getting error as - "String was not recognized as a valid DateTime."
What can be the reason for above error?
Regards,
Preeti
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Sorry for the delayed response.
I hope this solution will work. As of now I am facing issue while implementing this. I have done below steps -
1. In the test step example "Register TestCase"
2. Click on Insert Step > Groovy script and named as "NDate"
3. Copied the script given
4. Within "Register TestCase", For Date input parameter, added - ${#Register TestCase#NDate}
5. Ran Groovy script
6. Ran Register
At this time, getting error as - "String was not recognized as a valid DateTime."
What can be the reason for above error?
Regards,
Preeti
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi preeti, when referencing a test case property you need not to explicitly mention the testcase name if property is being called in the same testcase.
so your reference should be ${#TestCase#NDate}
thanks!
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can I get help on this query??
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have done extactly the same steps as mentioned. But getting error - String was not recognized as a valid DateTime.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
