Access any HTML elements through the DOM (Document Object Model).
Change the DOM – add, change and remove HTML elements.
Make HTTP/Ajax requests using the XMLHttpRequest object.
Check that the total of the shopping cart equals the sum of the individual items in the cart.
Check or change CSS attributes, such as text and background colors.
Set cookies for transactions (via
Send data to the server using HTTP POST.
Show additional data on a web page.
Rearrange the web page content for a better readability.
Configure the validation.
When editing the script:
Open the DéjàClick sidebar.
Record a script, or open a previously recorded script.
In the script, select an action (web page) or event for which you want to add a validation rule.
Validations added to an event run after the event has completed. Action validations run after the last event in the action.
Switch to the Properties tab in the lower half of the DéjàClick sidebar.
Configure the validation.
When replaying the script:
Pause the replay at the page you want to validate.
Tip: To set a pause before replaying, right-click the needed action (web page) or event and select Pause.
Configure the validation (see below).
Select which result to consider as a failure –
Select what to do if the validation fails:
Generate an error – stop the script with the "Validation failed" error.
Continue waiting – retry the validation until it either succeeds, or the event timeout elapses
(Optional) Under Evaluation Options, select the document (web page or frame) to validate. By default, this is a web page that contains the current event’s target object. If your web page contains several frames, or if it opened other web pages (for example, popups), you may need to select a specific document.
If you do not see Evaluation Options, replay the script and try again.
Once you are satisfied with the settings, click OK.
You can save the modified script to your computer, or upload it to AlertSite – a worldwide network of monitoring stations – for remote execution.
false. It can be a single expression:
window.document.getElementById("total").value == 500
or a multi-line script:
var total = window.document.getElementById("total").value;
total == 500
The final result is the value of the last expression. The trailing semicolon (;) is optional.
If the code is a function call that does not return a value, append "; true" at the end of the line to use
true as the result:
The result of the code can also be a string or a number. DéjàClick will convert it to the corresponding boolean value:
0, "" (empty string) –
1, -1, "done", "true" –
"0" and "false" (in quotes) – also
If the final result is of some other type (an object, array, and so on), it is ignored for security reasons. In this case, DéjàClick ignores the validation and continues the replay.
window.document instead of
document if you are also going to replay your DéjàClick script in Firefox.
Use Chrome Developers Tools (F12) to learn the IDs of web page elements.
Set Cookie for Transaction
VALUE with your values.
var cookie_name = "NAME";
var cookie_value = "VALUE";
document.cookie = cookie_name + "=" + cookie_value;
Check CSS Attributes
This code verifies that the warning element’s foreground color is red.
var obj_id = "warning";
var css_prop = "color";
var css_value = "rgb(255, 0, 0)";
var obj = window.document.getElementById(obj_id);
var strStyleValue = window.getComputedStyle(obj, "")[css_prop].toLowerCase();
strStyleValue == css_value
Check Web Page’s Last Modified Date
The code below verifies that the web page was last modified less than 12 hours ago. Add this code to the first event of a web page (action).
var dt = new Date(window.document.lastModified);
var TWELVE_HOURS = 12 * 60 * 60 * 1000; /* ms */
(new Date() - dt) <= TWELVE_HOURS