Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space FUNCTDEV and version SOAVIRT_9.10.6_CTP_3.1.2

This topic explains how to exercise greater control over the way that Virtualize record Web web scenarios.

You to can customize the clickable elements that can be recorded during scenario recording. The scripts to modify are located in the following directories:

...

  • _wk_Recorder.clickableAttributes: This variable defines the type of attribute of HTML elements that Virtualize is looking for when determining if it should record a click on this element. For example, the onclick is used to initiate script execution and is a good candidate in this array.

  • _wk_Recorder.clickableTags: This variable defines the HTML tags that will be considered 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.

  • _wk_Recorder.clickableInputTypes: This variable defines the form input types that will be considered 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.

  • _wk_Recorder.structuralTags and _wk_Recorder.containerTags: The following two variables work together to limit cases for which user actions are recorded against elements. User actions are not recorded for elements named in the former variable if those elements have at least one child element (either direct or indirect) that is specified in the latter variable.

    • For example, click actions on div elements are normally recorded, but sometimes a div element might not be used as a UI element. The element may 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, a click action could potentially be recorded against the container div that contains the table. You might not want a click action recorded in this case, though, because the div is used as a container element and not as a lower-level UI element. To tell Virtualize not to record the click action against the div in cases where the div contains a table element, you would ensure that the _wk_Recorder.structuralTags array (or equivalent) contains "div" and that the _wk_Recorder.containerTags array (or equivalent) contains "table".

  • _wk_Recorder.disallowedTags: This variable contains a list of tags that will never be recorded, even if they satisfy other recording criteria.

  • _wk_LocatorBuilders.order: This variable defines the order used 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> Browser> 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.

  • _wk_LocatorBuilders.preferredAttributesOrder: This field is used by the locator builders 'attributesXPath' and 'attributesXPathWithIndex' from the above _wk_LocatorBuilders.order. 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 elements

...