Selenium Dom values are not updated
I am seeing a problem in Selenium with IE6/8 that is giving me some bad time. The problem is that the DOM window properties are not updated after actions are done and always return the default values.
To give you couple o开发者_如何转开发f examples:
Browser is first launched in normal size (
document.body.clientHeight = 500px
). After I do window maximizing, the property stays500px
!Scroll top offset (
document.body.scrollop
) is initially0
, I then do scrolling, when I access the property it is till0
!
Has anyone seen this problem before or might know what is causing it?
To access the Window and document object in Selenium test you need to put this.browserbot.getUserWindow()
. It gives you access to the page that Selenium is working on.
int offset = Convert.ToInt32(selenium.GetEval("this.browserbot.getUserWindow().document.body.scrollTop"));
精彩评论