Argus9 Argus9 - 8 months ago 64
Ruby Question

Ruby Selenium WebDriver - get return value of execute_script

Simple question here - when I use

in a Ruby Selenium test, is there a way I can get the result of the JavaScript I ran?

This is the code I'm executing:
driver.execute_script '$.active'

Edit: The solution is so simple. I forgot to include
in the script.


You just need to add the return:

driver.execute_script 'return $.active'