I'm using the line of code:
driver.findElement(By.xpath("//*[@id=\"sernum\"]")).sendKeys("XXXXXXXXXX");
All I need to do is insert a value in the field. But it isn't work...
The fragment from "dom":
I'm using the line of code:
driver.findElement(By.xpath("//*[@id=\"sernum\"]")).sendKeys("XXXXXXXXXX");
All I need to do is insert a value in the field. But it isn't work...
The fragment from "dom":
To send a character sequence within the <input>
field as the element is a dynamic element you need to use WebDriverWait for the elementToBeClickable()
and you can use either of the following Locator Strategies:
cssSelector
:
new WebDriverWait(driver, 20).until(ExpectedConditions.elementToBeClickable(By.cssSelector("input#sernum[name=\"sernum\"]"))).sendKeys("XXXXXXXXXX");
xpath
:
new WebDriverWait(driver, 20).until(ExpectedConditions.elementToBeClickable(By.xpath("//input[@id='sernum' and @name=\"sernum\"]"))).sendKeys("XXXXXXXXXX");