cbahn001
9 years agoOccasional Contributor
How to use keyword statement While Loop based on if an Onscreen Object is visible?
I am testing a desktop app and trying to use a while loop to run a series of steps if an object is visible on screen, in this case it is an error that shows up if I a username has been used. Right n...
- 9 years ago
Since you say "So basically I am trying to enter a unique record into a database through the application". Can we assume your goal is to have a unique name every time? If yes, then you can eliminate the While loop totally.
There are multiple ways to do this:
Using Project Variables:
Create a Project Level variable (https://support.smartbear.com/viewarticle/77783/) to keep a track of the last value used to create the name.
Every time
1) Fetch the value
2) Increment it by one and use it to create a unique name
3) Store the new value back to the Project variable.
Using TimeStamp:
Append this to the Name to get a unique value everytime.
NewValue = OldValue + aqConvert.DateTimeToFormatStr(aqDateTime.Now(), "%m%d%y%H%M%S")