views:

220

answers:

1

The page I am trying to test sets the value of "global variables". From the Firebug, I can access those as properties of the window object (e.g. window.foo).

From Selenium however, typeof selenium.browserbot.getCurrentWindow().foo always return "undefined", say when used in the condition of a waitForCondition. Any idea of what I could be doing wrong?

A: 

I think it cant be done, it could be done in greasemonkey using unsafeWindow, however that doesnt work in selenium. i tried to do it using

addLocationStrategy
zzz
return prompt(inWindow.a);

and than

click
zzz=xxx

but i cant access it. if you have any ideas how to do it let me know.

if its your page maybe you could keep that variable in some html control. its a hack, but .....

01
So you are saying that when I want to check something (assertion), I can only check things on the DOM, not attributes of the window object?
Alessandro Vernet
that my opinion, but please prove me wrong :)
01