Is it possible to retrieve page JavaScript variables using Selenium? I have an application that utilizes a variable attached to the window object with global scope. This variable can be accessed using window._myvar
, window['_myvar']
, _myvar
, this['_myvar']
, or this._myvar
depending on the context.
I attempted to use Selenium to display this variable. From what I understand, in Selenium IDE, everything runs within the context of selenium
. I tried commands like
this.browserbot.getCurrentWindow()._myvar
and this.browserbot.getCurrentWindow()[_myvar]
without success. Instead, I encountered the error message: Unexpected Exception: message -> eval(match[1]) is undefined
.
Has anyone successfully accessed their page's JavaScript using Selenium?