Synthetic script entering username with special character

writing a script for login page
username is “test\123”
used sendkeys(“test\123”) but it entered test123 instead of test\123

How to pass this special character?

Hi, @hemanth-kumar.kari-w: Try doubling the backslash character:

const By = $driver.By;

$browser.get('https://login.newrelic.com/login')
  .then(function(){
    return $browser.findElement(By.id('login_email')).sendKeys('test\\123');
  });

Screen Shot 2021-09-13 at 10.17.48 AM

2 Likes