Your data. Anywhere you go.

New Relic for iOS or Android

Download on the App Store    Android App on Google play

New Relic Insights App for iOS

Download on the App Store

Learn more

Close icon

Not able to proceed with scripted browser after click


The scripted browser is not giving the expected output.
after searching the email from the dropdown, trying to click on view which should take me to customer page which is failing. Looks the page wait functions need to be added which I’m not sure.

Any help is appreciated.


@RyanVeitch can you help me on this request?


Hi @yograj.patel - Ryan is offline at the moment. While we Relics can view your link, others in the community who may have advice can not. DO you mind posting your script directly here so that others can take a look?


var assert = require(‘assert’);
var By = $driver.By,
// Navigate to the myaccount login page
$browser.waitForAndFindElement($‘CoxPFHeader’), 45000)
.then(function() {
// locate login field and enter Email
return $browser.findElement($‘USER’)).sendKeys(‘a1newrelic’);
.then(function() {
// locate password and enter info
return $browser.findElement($‘PASSWORD’)).sendKeys(‘xxxxxxxxx’);
.then(function() {
// Press submit button
return $browser.findElement($‘sign-in-btn’)).click();
//.then(function() {
// Search for an account and click ok
// return $browser.FindElement($“searchtypedropdownbox”));
return $browser.waitForAndFindElement($‘searchType’), 50000)
.then(function(elem) {
selectbox = elem;
//Wait till dropdown opens
.then(function() {
return selectbox.findElement(By.xpath("//option[contains(.,‘Email’)]")).click();
.then(function() {
// enter email info
return $browser.findElement($‘email’)).sendKeys(‘’);
.then(function() {
// Press submit button
return $browser.findElement(By.xpath(’//[@id=“c-container”]/app-root/app-shell/app-start/form/div[3]/div/button’),5000).click();
return $browser.findElement(By.xpath(’//


@yograj.patel In a scripted browser test that we run, we put put a given string in a search field, wait 2s for the response to come back, and then select the first entry, and hit the search button. This is done in this way. Maybe you can do something similar?

$browser.waitForAndFindElement($driver.By.css("div.suggestion"), 2000);

If you don’t get any further with the above suggestion, add some of these blocks to see until where you’ve progressed successfully:

console.log("Step XYZ reached");


Thanks Everyone.

just tried the browser sleep at the end and it worked.


Newrelic is fun :slight_smile: