This topic explains how to exercise greater control over the way that SOAtest records Web web scenarios.
SOAtest allows you to customize the clickable elements that can be recorded during scenario recording. The scripts to modify are located in the following directories:
For Chrome : <SOAtest
_
Installation_Directory>/eclipse/plugins/com.parasoft.xtest.libs.web_<SOAtest
_version>/root/browsers/chrome/UserCustomizableOptios.js
For Internet Explorer : <SOAtest_Installation_Directory>/plugins/com.parasoft.xtest.libs.web_<SOAtest_version>/root/browsers/ie/UserCustomizableOptions.js
For Firefox : <SOAtest_Installation_Directory>/eclipse/plugins/com.parasoft.xtest.libs.web_<SOAtest_version>/root/browsers/ff/user.js
ext.options.clickableTags (extensions.soatestFirefoxRecorder.clickableTags): This variable defines the html tags that SOAtest will consider when recording click actions. In an Ajax web application, there are cases where tags such as span or li are clicked that caused certain functionalities to execute on the client side. This variable is used to define such tags.
ext.options.clickableInputTypes (extensions.soatestFirefoxRecorder.clickableInputTypes): This variable defines the form input types that SOAtest will consider when recording clicks. Types such as text and textarea are not considered clickable by default because the user usually clicks on it just to gain focus and enter text.
For example, SOAtest normally records click actions on div elements. However, sometimes a div element might be used not as a UI element; instead, it could be used as a container element that contains a number of other elements (e.g., it could contain a table that contains many other elements). In this case, SOAtest could potentially record a click action against the container div that contains the table—but you might not want a click action recorded here because the div is used as a container element and not as a lower-level UI element. To tell SOAtest that it should not record the click action against the div in cases where the div contains a table element, you would ensure that the ext.options.structuralTags
array (or equivalent) contains "div" and that the ext.option.containerTags
array (or equivalent) contains "table".
ext.options.locatorBuildersOrder (extensions.soatestFirefoxRecorder.locatorBuilderOrder): This variable defines the order in which SOAtest uses to create the locator. A locator is created to identify the html element on the page that the user action should take place. It is needed during playback to repeat the user action. The order is constructed such that visual attributes in an element are more favorable when creating the locator.
To see which locator builder is used, enable debugging information in the console
(Parasoft> Preferences>SOAtest> Browser Playback> print debugging information). With this enabled, the console will show messages such as
Locator - /descendant::img[@id='changeing'][1]. Used id builder
. This tells you what locator from LocatorBuilders.order is actually used (in the above example, Used id builder
is used). See Browser Settings for more information about this option.
This field is used by the locator builders 'attributesXPath' and 'attributesXPathWithIndex' from the above
When invoked, this array determines the preferred attributes used. You can add, remove, or reorder attribute names to this array to better customize the locators that get built for elements on your site. Removing an attribute will prevent it from being used by the aforementioned locator builders (which may be important if you know certain attributes on your web page are dynamic and should never be used). Re-ordering the attributes will change the priority of the attributes. The first attributes of the array, like 'id', take precedence to be used in locators over the last elementsext.optionslocatorBuilders.order
.
ext.options.xpathLibrary (extensions.soatestFirefoxRecorder.xpathLibrary): This variable lets you configure SOAtest to use a specific XPath library for resolving XPath locators used in web scenarios. It applies only to Internet Explorer and Chrome. This option has three possible values: ajaxlt, wgxpath, and default.