My testcase in wiki page is failing because the text field compared from UI screen and test value are different in Appian FitNesse scripts
|verify field |Due Date |in section|Information|contains|Apr,2019 |
PFB the execution log for reference.
2019-04-02 19:03:19,021 [main] DEBUG com.appiancorp.ps.automatedtest.tempo.interfaces.TempoReadOnlyField - READ ONLY FIELD COMPARISON : Field value [Apr, 2019] compared to Test value [Apr] 2019-04-02 19:03:19,021 [main] DEBUG com.appiancorp.ps.automatedtest.common.AppianObject - STRING COMPARISON: Field value [Apr, 2019] compared to Test value [Apr]Though I have mentioned Apr,2019 in script , it is considering Apr and hence when compared against Field value from UI --> Apr,2019 , it is failing.Any inputs in this regard will be useful.
Discussion posts and replies are publicly visible
Hello Priyankav,
try to define a variable (Using DEFINE at the top) with a value like this "{Apr, 2019}" and then use the variable ${variable}
it seems like it is taking the comma as a separator of multiple values.
Jose
Hi Jose,
I have defined the variable in variables file like below,
!define DueDate {Apr, 2019}
The due date is a text field .I am using the variable like shown below in the wiki page.
|verify field |Due Date |in section| Information|contains|${DueDate } |
Still , it takes the text before comma , PFB the execution log :
2019-04-04 11:41:19,864 [main] DEBUG com.appiancorp.ps.automatedtest.tempo.interfaces.TempoReadOnlyField - READ ONLY FIELD COMPARISON : Field value [Apr, 2019] compared to Test value [Apr] 2019-04-04 11:41:19,864 [main] DEBUG com.appiancorp.ps.automatedtest.common.AppianObject - STRING COMPARISON: Field value [Apr, 2019] compared to Test value [Apr]Regards,Priyanka
Hello Priyanka,
Sorry about the late reply, but hopefully this can be helpful for future references.
You can use this fixture method:
|verify field|FIELD_LABEL or [FIELD_INDEX] or FIELD_LABEL[INDEX]|contains value|VALUE|to verify a field contains a value that has a comma.In your example, it would be|verify field |Due Date |in section|Information|contains value|Apr,2019 |Note that we also have a similar method for populate a field with a value that contains a comma,
|populate field|FIELD_LABEL or [INDEX] or FIELD_LABEL[INDEX]|with value|VALUE|These methods are all documented in the cheatsheet as well. Thank you for using FitNesse for Appian.