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!
Selenium - Executescript passing variable Topic is solved
Re: Selenium - Executescript passing variable Topic is solved
Code: Select all
var := "hello world"
element := driver.FindElementsbyXpath("//input[@name='InvoiceItemNumber']")
driver.executeScript("arguments[0].setAttribute('value', '" . var . "');", element)
Re: Selenium - Executescript passing variable
Thank you so much, works like a charm. Much appreciated !
Xtra wrote: ↑23 May 2020, 15:52Code: Select all
var := "hello world" element := driver.FindElementsbyXpath("//input[@name='InvoiceItemNumber']") driver.executeScript("arguments[0].setAttribute('value', '" . var . "');", element)
Who is online
Users browsing this forum: audante, Bing [Bot], Chunjee, Google [Bot], mikeyww, RyantheCoder, SenseElation, vilson yuri and 36 guests