Currently, I am using WebdriverJS to interact with a form. In my test, I want to open the form, fill in a field using sendKeys, and then store this value in a variable. Here is the code snippet:
driver.findElement(By.xpath("//a[contains(text(),'Añadir Propuesta Test')]")).click();
driver.wait(function () {
return driver.isElementPresent(By.css(".form-control.col-md-8"));
}, 15000);
var propuesta = driver.findElement(By.name('rut'));
propuesta.sendKeys('1111122222');
propuesta.getText().then(function(text){
console.log(text);
});
However, the actual result is returning an empty value.
https://i.sstatic.net/MHPDz.png
I am wondering how I can use sendKeys and also store the value that was sent?