Forum Discussion
- Hassan_BallanFrequent Contributor
Hello, I understand your application creates new record with ID string based on current date time (for example YYYYMMDDhhmmssSSS "20250108115133999") and you want to validate that it is the correct value.
Is that correct? can you provide your string format?If my assumptions is correct, you can do that with writing code to generate a string based on current date time, read the record ID value and compare it with the string you generated. The challenge would be the time difference from when the record was created and when you generate your string. To overcome I suggest you skip the seconds and milliseconds, and perhaps also skip the minutes.
The following documentation can help you https://support.smartbear.com/testcomplete/docs/scripting/working-with/index.html
- JDR2500Frequent Contributor
I agree with Hassan_Ballan,
First, the date/string format you get is a big factor. Without seeing the precise format, we can only speculate.
Second, checking for the exact time is a recipe for failure in my experience. As suggested, it would be more robust to skip at least everything after the minutes.
Third, a property checkpoint using a regular expression may be the way to go. That would give you greater flexibility over how you validate the value. See: Regular Expressions Syntax | TestComplete Documentation
Finally, there are aqDataTime methods that will let you extract the portions of the date/time you want and compare them. See: aqDateTime Object Methods | TestComplete Documentation
- rraghvaniChampion Level 3
Are you referring to the tested "value" that's changing which fails the checkpoint?
- RaghunandanitsOccasional Contributor
Yes, for example, once case is created each case will have unique case id which we would like to verify.
- rraghvaniChampion Level 3
Depending on your test scenario, you could implemented https://support.smartbear.com/testcomplete/docs/testing-with/data-driven/index.html
For example, if you are testing a calculator app, the result will always change depending on the input you have provided - use data driven testing for this.
Related Content
- 6 years ago
- 3 years ago
- 3 years ago
Recent Discussions
- 13 hours ago
- 15 hours ago