How to create a property checkpoint for hard code value & a variable
Hi, I am trying to create a property checkpoint for a 'WndCaption' property. Value should always match to "Last Visit 9/10/2015 (0 days ago)". Here date value may change and even the number 0 may change depending on the test case. I have tried using wild characters like "Last Visit * (* days ago)". But it's not working. Any suggestion please. Also is there anyway I can make sure date is today's date? I am using keyword testing. Any help is appreciated. Thanks.
the string you want to use as a baseline will look something like this:
"Last Visit " + aqDateTime.Today() + " (" + myvariablefornumberofdays + " days ago)"
Instead of using a Property Checkpoint, build your own with an If Then. See attached screenshot.
What Marsha_R said, but with two notes:
1) You may need to format the date using aqConvert.DateTimeToStr or aqConvert.DateTimeToFormatStr.
2) No need for If...Then -- you can use variables in checkpoints directly. First, create a checkpoint with the hard-coded value first. Then click the checkpoint's Value string, press F2 and replace the hard-coded value with a variable.