I’m using Selenium2 for some automated tests of my website, and I’d like to be able to get the return value of some Javascript code. If I have a foobar() Javascript function in my webpage and I want to call that and get the return value into my Python code, what can I call to do that?
I’m using Selenium2 for some automated tests of my website, and I’d like to
Share
To return a value, simply use the
returnJavaScript keyword in the string passed to theexecute_script()method, e.g.