Fitnesse :How to verify default values in field?

Hi all,

Can anyone please suggest me how to verify default values on the page load?

|verify field | --> this keyword is not working

  Discussion posts and replies are publicly visible

  • What you can do is establish a local variable to store a default value to be displayed (that is included in the array used for 'choiceValues') so when you load your page the first time it will be showing a value selected by default. Hope this example can explain better what I said:

    load(

     local!defaultValue:2,         /* Here you set the default value you want to display */

     {

       a!dropdownField(

         label: "Prueba",

         choiceLabels: {

           "Choice 1",

           "Choice 2",

           "Choice 3",

           "Choice 4"

         },

         choiceValues: {

           1,

           2,

           3,

           4

         },

         value: local!defaultValue,

         placeholderLabel: "Any",

         saveInto: local!defaultValue

       ),

       a!richTextDisplayField(                               /* This is just to display local variable */

         value: a!richTextItem(

           text: local!defaultValue

         )

       )

     }

    )

  • I don't think the |verify field| method is going to work since it checks the "value" parameter of the field (which is this case is null). Unfortunately, I'm not aware of any FitNesse method that will check the "placeholder" parameter of a field.
  • Hi Minakshis001,

    You can try using below methods.
    If it is a user filter use this method
    | verify record type user filter | USER_FILTER_NAME | is present |

    Or you need to populate that value first and verify the value.

    | populate field | FIELD_LABEL or [INDEX] or FIELD_LABEL[INDEX] | with | VALUE(S) |
    | verify field | FIELD_LABEL or [FIELD_INDEX] or FIELD_LABEL[INDEX] | contains | VALUES() |.

    Please let me know if none of the above is not working for you.
  • even try this
    |Check| populate record type user filter | USER_FILTER_NAME | with | USER_FILTER_VALUE |VALUE|