Reply To: obligatory TextInput

PennController for IBEX Forums Support obligatory TextInput Reply To: obligatory TextInput



The code you report mixes Html and TextInput elements, when I presume you’d rather use only one type of element. Html elements are used exclusively to embed the content of an Html file that you have uploaded to your project, and I doubt that you have an Html file named “Background Information.” The complete test checks all the fields with the class obligatory in the corresponding file have been completed. This is not the test to use in the code you report since there is no “Background Information” Html file to start with.

What you want is a test on your TextInput element: you want to make sure it is not empty. To do so, you need to use the text test on your TextInput element (or, rather, its negation) like this:

newText("Date of Birth: (MM/DD/YYYY) After entering your date of birth in the box below, press the Return/Enter key.")
  .wait( getTextInput("background").testNot.text("") )

NB: in your case, because you want a date in a specific format, you could even test the text using a regular expression: getTextInput("background").test.text(/^\d{2}\/\d{2}\/\d{4}$/)

Let me know if you have more questions