This topic provides tips on how to record clicks on calendar widgets (e.g., a travel site’s calendar implemented using text input fields) in SOAtest and Virtualize.
Sections include:
By default, clicks on text input fields are not recorded as a separate step to prevent unnecessary noise. For instance, typing username credentials into a login field would otherwise be recorded as two steps: one for clicking on the field and one for typing.
However, this default behavior is not always desirable. For instance, many travel sites have departure and return date fields that, when clicked upon, open a calendar widget. The date is populated when the user clicks on a date element in the calendar.
After creating a web recording with these actions, you may find that the click action on the calendar element was recorded, but the preceding click action on the text input field was not. The calender element click action will fail during playback because it cannot find the calendar.
There are three ways to modify this behavior for recording clicks on text input fields:
Modify the UserCustomizableOptions.js file or prefs.js file for Firefox (see the following procedure for details). However, this will cause unneeded tests or actions as described above.
To modify the UserCustomizableOptions.js or user.js file:
<
Installation_Directory>/eclipse/plugins/com.parasoft.xtest.libs.web_<version>/root/browsers/chrome/UserCustomizableOptions.js<
Installation_Directory>/plugins/com.parasoft.xtest.libs.web_<version>/root/browsers/ie/UserCustomizableOptions.js<
Installation_Directory>/eclipse/plugins/com.parasoft.xtest.libs.web_<version>/root/browsers/ff/user.jsLocate the part of the code that looks like this UserCustomizableOptions.js snippet (or its user.js equivalent):
ext.options.clickableInputTypes = [ "submit", //record click event on submit input type element "button", //record click event on button input type element "image", //record click event on image input type element "radio", //record click event on radio input type element "checkbox", //record click event on checkbox input type element "reset" //record click event on reset input type element ] |
Anywhere between the brackets "[]", add another line that says "text" so that it looks like this:
ext.options.clickableInputTypes = [ "text", //text on travelocity.com "submit", //record click event on submit input type element "button", //record click event on button input type element "image", //record click event on image input type element "radio", //record click event on radio input type element "checkbox", //record click event on checkbox input type element "reset" //record click event on reset input type element ] |