Selenium IDE - Placeholder

-1

I'm having trouble automating a test where I fill in a placeholder and save. When checking what I saved, I verify that the information entered in the field was not made.

<input id="nomeCliente" class="form-control ng-pristine ng-valid ng-touched" _ngcontent-c8="" maxlength="150" placeholder="Nome Cliente" type="text" style="background-color: rgb(255, 255, 255);">
    
asked by anonymous 11.07.2017 / 17:13

2 answers

0

You may be getting the wrong field to facilitate, you can get this field as below:

driver.findElement(By.id("nomeCliente")).sendKeys("Nome Cliente");

This way you will find the element via ID and pass whatever you want to fill with sendKeys

    
18.07.2017 / 14:22
0

Placeholder has nothing to do with the field type, what you need to work with is the input, placeholder is just a property of an input, I suggest you read more about this in the following link

Regarding your real problem, it's the way you're trying to send information to the field. Whenever you need to enter data into a text field (input) you should use the sendKeys () method, if you need to clear the data before inserting (so that you do not concatenate values) simply use the clear () command.

driver.findElement(By.id("nomeCliente")).clear();
driver.findElement(By.id("nomeCliente")).sendKeys("Nome Cliente");
    
25.10.2017 / 13:15