从Selenium IDE访问Javascript全局变量

从Selenium IDE访问Javascript全局变量,javascript,testing,selenium,selenium-ide,Javascript,Testing,Selenium,Selenium Ide,我正在使用最新的Selenium IDE 2.2.0 我在尝试访问脚本中设置的javascript全局变量时遇到问题 这个变量充当成功标志,因此我将 Command: waitForCondition Target: test Value: 2000 但我明白了 [error] test is not defined 我试着看了看,换了 Target: this.browserbot.getUserWindow().test 但我也有 [error] this.browserbot is

我正在使用最新的Selenium IDE 2.2.0

我在尝试访问脚本中设置的javascript全局变量时遇到问题

这个变量充当成功标志,因此我将

Command: waitForCondition
Target: test
Value: 2000
但我明白了

[error] test is not defined
我试着看了看,换了

Target: this.browserbot.getUserWindow().test
但我也有

[error] this.browserbot is undefined
我可以尝试另一种设置成功标志的方法,比如抛出警报,但我想知道如何访问我的javascript变量


文档中提到了storedVars,但这只是存储在selenium中的变量,因此我束手无策。

我仔细查看了一下,找到了以下文档,以供参考

Command: waitForEval

Note that, by default, the snippet will run in the context of the "selenium" object
itself, so this will refer to the Selenium object. Use window to refer to the window 
of your application, e.g. window.document.getElementById('foo')

If you need to use a locator to refer to a single element in your application page, 
you can use this.browserbot.findElement("id=foo") where "id=foo" is your locator.
诸如此类

window.test
工作