I am trying to set the value of textarea using the javascript method instead of send_keys ().
As the documentation says, I should be able to pass webelement to execute_script as a parameter and access that parameter through an array of arguments . However, I checked in firefox js console that the arguments are Object, and it doesnāt matter that I set execute_script as an argument. arguments always empty.
>>>> web = webdriver.Firefox() >>>> web.get("http://somepage.com") >>>> element = web.find_element_by_tag_name("textarea") >>>> web.execute_script("return typeof(arguments)", element) u'object' >>> web.execute_script("return arguments",element) []
Does anyone have experience with a similar topic? How can I put webElement as an argument for javascript?
Using Firefox 35.0, selenium 2.44.0.
source share