Synthetic Classic has reached end of support and is no longer available. Existing Synthetic Classic customers have been upgraded to the all-in-one Dynatrace software intelligence platform.

URL validation

This sample code checks whether a specific URL is shown in the browser. As an example, when you go to the Synthetic Classic Portal, you are redirected to To perform validation that this is the page we landed on, we can use the following code in a Custom action with gomez_top[0] as the target.

When the expected URL is found, we add a hidden DIV element to the page. At the end of the step, we can then place a Validate action, set to validate against a specific element. The element to validate against is #URLMatch. The script will then fail if any other URL is shown in the browser.

// Grab the current URL
var fullUrl = window.location.pathname +;

// Check to make sure it matches what we are looking for
if (fullUrl.indexOf("") !== -1)
	alert ("found the URL we searched for"); 

	// create an element on the page with an ID attribute of #URLMatch.
	// We will use this element for a Validation action.
	var el = document.createElement('div'); = 'URLMatch';
	alert ("added #URLMatch to the page for validation");