Selenium - Executescript passing variable
Posted: 23 May 2020, 13:59
Hi!
Im trying to replace "hello world" below with a variable, but I just cant find the way to do so, i always get an error probably because the code is just wrong.
driver.executeScript("arguments[0].setAttribute('value', 'hello world')", driver.FindElementsbyXpath("//input[@name='InvoiceItemNumber']"))
Does anyone have any exeperience with this being possible at all?
Thanks in advance!
Im trying to replace "hello world" below with a variable, but I just cant find the way to do so, i always get an error probably because the code is just wrong.
driver.executeScript("arguments[0].setAttribute('value', 'hello world')", driver.FindElementsbyXpath("//input[@name='InvoiceItemNumber']"))
Does anyone have any exeperience with this being possible at all?
Thanks in advance!