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

Secure Credential's sent as string in example

secure-credentials

#1

Using secure credentials in your example I have the following code:

function loginUser(){
var username = ‘$secure.AUTH_PROD_USER’
var password = ‘$secure.AUTH_PROD_USERPWD’
return $browser.findElement($driver.By.name(“logonId”)).sendKeys(username).then(function(){
return $browser.findElement($driver.By.id(“password”)).sendKeys(password).then(function(){
return $browser.findElement($driver.By.xpath("/html/body/div[3]/div[2]/div[2]/div[2]/div[1]/form/fieldset/div[4]/button")).click().then(function(){
console.log(“Logging in.”)
});
});
});
}

When it runs the variables send the sting format of ‘$secure.AUTH_PROD_USER’:

When I remove the ’ ’ from the variable username and password, I get the following error for username and password in sendKeys:

Argument of type ‘$secure’ is not assignable to parameter of type ‘string | Promise’.
(local var) username: $secure

I am a bit of a loss here on why the $secure agument type is not set to string.

Thanks for any help!


#2

Hi, @brsanti: The editor’s syntax checking sometimes gets confused. What happens when you click the Validate button to run the script?


#3

Gah! It works fine… guess the confused syntax checking confused me :upside_down_face: Thanks for the reply Phil!


#4

Yes, it is annoying. If it cannot be relied upon, I wish there were an option to turn it off!