Hi Experts,
I read through the scripted browser documentation and was able to write a basic login automation as follows. However the main issue I am seeing is that after logging into the URL, even though I pass “empty” username and password, the script still says “Validated” with a green check which i suppose means is that it validated. In my opinion the script should fail saying that script did not pass as the username or password were either empty OR incorrect. How do i do that verification step?
$browser.get("https://mail.yahoo.com").then(function(){
//Find the user name field by specifying its name, then submits a secured username.
return $browser.findElement($driver.By.name("username")).sendKeys("");
}).then(function(){
//Find the password field by specifying its name, then submits a secured password.
return $browser.findElement($driver.By.name("password")).sendKeys("");
}).then(function(){
//Find and click the login button.
return $browser.findElement($driver.By.xpath("/html/body/div[2]/div/div/div/div[2]/div/ul/li[2]/div/form/div[1]/div[3]/button/span[1]/span")).click();
});