Reading JavaScript variables using Selenium WebDriver

All you have to do is:

Object val = js.executeScript("return returnFoo();");

That will give you what you are looking for.

Leave a Comment