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:
Understanding the Default Recording Behavior for Text Input Fields
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.
Modifying the Recording Behavior for Text Input Fields
There are three ways to modify this behavior for recording clicks on text input fields:
- Most text input fields of this type have a calendar icon next to them. If they do, click on this icon instead of the text input field.
- Record the scenario, then later manually add the steps to click on the text input field.
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.
Modifying the UserCustomizableOptions.js or user.js file
To modify the UserCustomizableOptions.js or user.js file:
- Navigate to the file.
For Chrome:<
Installation_Directory>/eclipse/plugins/com.parasoft.xtest.libs.web_<version>/root/browsers/chrome/UserCustomizableOptions.js
For Internet Explorer:<
Installation_Directory>/plugins/com.parasoft.xtest.libs.web_<version>/root/browsers/ie/UserCustomizableOptions.js
For Firefox:<
Installation_Directory>/eclipse/plugins/com.parasoft.xtest.libs.web_<version>/root/browsers/ff/user.js
Locate 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 ]