Created
July 20, 2021 15:14
-
-
Save gspncr/1b0577a02b1e3533b798e430a20c5471 to your computer and use it in GitHub Desktop.
Scripted Browser monitor script that will fail if the text “Log In” is present on the New Relic homepage:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Scripted Browser monitor script that will fail if the text “Log In” is present on the New Relic homepage: | |
var assert = require('assert'); | |
var URL = 'http://newrelic.com'; | |
var textToFind = 'Log In'; | |
$browser.get(URL).then(function(){ | |
return $browser.findElement($driver.By.tagName('html')).getText(); | |
}).then(function(body){ | |
var textFound = (body.indexOf(textToFind) > -1); | |
assert.equal(textFound, false, '"' + textToFind + '" found on page.'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment