开发者

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:

  1. Browser is first launched in normal size (document.body.clientHeight = 500px). After I do window maximizing, the property stays 500px!

  2. Scroll top offset (document.body.scrollop) is initially 0, I then do scrolling, when I access the property it is till 0!

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"));
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜