Keyword Validation

A powerful feature of DejaClick is Keyword Validation. Keywords are very useful for detecting if your page is not loading correctly, has changed significantly or has been hacked.

Keyword Entry

In DejaClick, keywords can be:

  1. Auto-Suggested
  2. Entered Manually
  3. Taken from page source

AutoSuggest: The DejaClick "AutoSuggest" keywording tool is where text suggestions are made by moving the mouse around the page and clicking to add the text string that is displayed as a suggestion. Keywords created using the AutoSuggest tool are also automatically associated to a specific target document/frame where the click occurred.

Manual Entry: You can also manually enter or edit keyword text strings. This is an option for special cases where non-standard behavior is needed or fine tuning is required. Keyword text strings are entered into (or edited) using the Add/Edit Keyword dialog (illustrated below). Various other options are available, depending upon whether you're in Basic or Advanced display level.

Page Sourced: Keywords can also be added by selecting a small area of content on the page (click-and-drag), then clicking on the highlighted content to bring up the keyword dialog. The associated source for the selected content is displayed in the dialog as the keyword text string, which may be further refined and edited as needed.

In all cases, keywords can use either plain text or regular expressions for performing more complex matches.


AutoSuggested keywords work by inspecting the "inner text" of web page's HTML (structural) content for the page element the mouse is hovering over. DejaClick suggests pre-sized text strings for the text appearing between a specific pair of HTML element tags. Take, for example, the following web page source:

    <h4>this is one string of text</h4>
    <p>this is a different string of text</p>

DejaClick would offer two different text keyword suggestions when moving the mouse of each, respectively:

  1. "this is one string of text"
  2. "this is a different string of text"

The AutoSuggest Keyword facility suggests only visible text on the page that is contiguous within the actual page source.

As another example, the Google home page display the three following links:

Advertising Programs - Business Solutions - About Google

However, only the text appearing for the Business Solutions and About Google links can be keyworded using AutoSuggest. This is because the Advertising Programs HTML link in the source of the page is not contiguous. Rather, it's broken up by a special &nbsp; "entity" character, as shown below:

<a href="/intl/en/ads/">Advertising&nbsp;Programs</a>

Manually Entered Keywords are useful when needed, but have their trade-offs. One disadvantage to creating keywords manually is that they are not "pre-validated" as they are when DejaClick suggests keywords during mouse-overs. Since keyworded text may actually look different within the internal source of the page from the way it appears visually on the page (see Google example above), keyword validations may fail if their text spans across HTML element tags. Therefore, you always need to replay your transaction to find out if your manual keywords are working correctly, whereas AutoSuggested keywords are already checked at the moment they are created.

Another disadvantage to manually created keywords is that a specific document/frame is not automatically associated with the keyword (since there was no click event used to create them). Thus, all open documents will be searched by default. This can be adjusted by manually selecting a specific target document in the Add/Edit Keyword dialog if required (Advanced display Level).

Page Sourced Keywords work by scanning the underlying page source for a matching block of source text, and can include the HTML tags and other structure content. This can be useful in special cases, but can be more "brittle" than standard AutoSuggested keywords because it relies on matching an exact portion of the underlying page structure (source code). If the source of a web page changes, AutoSuggested keywords may still work correctly, as long as the text is unchanged. But if you have keyworded chunks of the page source, any future changes to that source code will cause a validation failure.

Below is an example of using AutoSuggest to add Keyword Validation.

Back to top

Add Keyword to Script

During recording or replay (Action or Event), the Validation icon Open_validation.png on the DejaClick toolbar will activate at the pause. Click the down arrow next to the icon and select Open Validation Panel from the dropdown to display the Validation Panel above the main window:


With the cursor hovered over some text on the page, in this example, “Advanced Search”, those keywords appear in the keyword selection box in the Validation Panel. Just click to select the keywords. The Add Keyword Validation dialog appears, which allows you to modify some criteria related to the keywords. You will have different properties to modify depending on your display mode, Basic or Advanced. Here are the dialogs for both display modes:

Basic:   Advanced:
Add_keyword_basic.png   Add_keyword_advanced.png

Click OK to save the keywords and close the dialog. You can select additional keywords from this page by repeating the process of hovering over some text, clicking to display the dialog, and clicking OK to save.

To stop selecting keywords and continue with recording, click the down arrow next to the Validation icon in the DejaClick toolbar and select Close Validation Panel from the dropdown to close the Validation Panel.

Back to top

Keyword Error Detection

If the web site changed from what it was during the recording such that the expected text no longer exists on the page, the keyword or phrase will not be found during replay and an error will be displayed, stopping the replay:


Click the down arrow next to Additional information to display more information, including the actual keyword in error:


You can modify this on the fly through the Keyword Validation property panel in the Properties Sidebar. Click on the Properties tab in the DejaClick sidebar, then click Keyword Validation to open the panel:


Click on the erroneous keyword to highlight it. This activates the Edit button. Click the Edit button to display the Edit Keyword Validation dialog:


Enter a new keyword or phrase, then click Apply. Keep in mind that keywords are case- and space-sensitive. In this example, we have an easy choice to change to:


The Keyword Validation property panel will display the new keyword:


Click the Replay button to make sure the keyword works correctly.


Another method for changing the keyword is to delete the keyword (highlight it and click the Remove button), set the Replay selection to Replay next event, and step through the replay until you get to the page you want to keyword. Open the Validation Panel and follow the steps described above.

Non-English Keywords

You can also select non-English keywords while recording. It works the same way to detect if the words are not on the page in the manner expected. The only way to add these keywords is through Auto-Suggest. Here's an example of selecting Chinese words that use Zhongwen characters:


Add Keyword Dialog   Keyword Property Panel in Sidebar
Add_Chinese_KW.png   Sidebar_Chinese_KW.png

Back to Top