I am new to using selenium and I have a few questions about my first script.
driver.findElement({ css: '.input[name=login]' }).sendKeys('login');
//driver.sleep(0);
driver.findElement({ css: '.input.passwd' }).sendKeys('passwd');
driver.sleep(5000);
driver.findElement({ css: '.button[type=submit]' }).click();
driver.sleep(10000);
driver.getTitle().then(function(title) {
console.log(title);
assert.ok(title.indexOf('Title') > -1, 'Wrong title');
}
Upon execution, I find myself still on the login page with only one error message stating "AssertionError: Wrong title". Even though Selenium typically throws an error if an element cannot be located (such as "NoSuchElementError: no such element: Unable to locate element:"), all elements seem to have been found and all actions like "sendKeys" and "click" were successful. However, this does not appear to be the case.
How can I verify this during the execution of the script?
Is there a way for me to view the query that Selenium generated and sent to the server?
UPD:
<input name="login" value="" type="text" class="input" tabindex="5">
<input name="" value="" type="password" class="input passwd" tabindex="6">
<input hidefocus="true" type="submit" class="button"></input>