I have element in my code that looks like this:
<input id="invoice_supplier_id" name="invoice[supplier_id]" type="hidden" value="">
I want to set its value, so I created a web element with it's xpath:
val test = driver.findElements(By.xpath("""//*[@id="invoice_supplier_id"]"""))
but now I dont see an option to set the value...
This question is related to
java
selenium
xpath
selenium-webdriver
selenium-chromedriver
driver.findElement(By.id("invoice_supplier_id")).setAttribute("value", "your value");
As Shubham Jain stated, this is working to me: driver.findElement(By.id("invoice_supplier_id")).sendKeys("value"??, "new value");
Source: Stackoverflow.com