Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Suggested Answer
+3
person also asked this
people also asked this
Replies
4 replies
Answers
1 answer
Subscribers
9 subscribers
Views
2750 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
Fitnesse for Appian
Anu
over 7 years ago
Hi All ,
I have a scenario where I have to validate a date picker field which displays todays date . How do I achieve this in fitnesse ? Please advise
Note :- The field is disabled/read-only .
OriginalPostID-270384
Discussion posts and replies are publicly visible
0
lucasj
A Score Level 2
over 7 years ago
Hi Anushris,
You should be able to achieve this with
| verify field | Date | contains | 3/16/2017 |
Thanks,
Lucas
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Anu
over 7 years ago
Hi lucasj,
But the date here is dynamic . Say if I run my script tomorrow it will fail . So any suggestions how do I handle this ??
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
+1
lucasj
A Score Level 2
over 7 years ago
Hi Anushris,
Try using
|verify field | Date | contains value | !today (MM/dd/yyyy) |
Note that you will need to remove the ! before |script| at the beginning of your fixture table, as preceding a test table with ! will make any widgets (like the !today function) inoperable.
Thanks,
Lucas
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Reject Answer
Cancel
0
martinc8721
over 7 years ago
Hi Anushris,
You could try the following expression
load(
/*local!newDueDate_date: todate("3/16/2017"),*/
local!newDueDate_date: ri!runningDate,
a!dateField(
label: "Date",
labelPosition: "ADJACENT",
value: local!newDueDate_date,
readOnly: "true",
validations: {
if(
todate(
local!newDueDate_date
) <> todate(
today()
),
"Date must be today’s date",
{}
)
},
requiredMessage: "Date is required",
required: true()
)
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel