开发者

How should I handle the scroll down operation in the script?

In order to capture a bitmap located at the end of the web page, I have to scrolldown the page (if not the code is not capturing the bitmap). How s开发者_如何学JAVAhould I handle the scroll down operation in the script?


Are you preforming a bitmap checkpoint on an IMG element in the web application? If so then QTP should automatically scroll the object into view. If it doesn't you can try using the undocumented MakeObjVisible method.

Browser("B").Page("P").Image("I").MakeObjVisible


I would prefer the solution of Motti, but if you really, really, really want to perform a scroll down, you can send the type command for the END button to the browser, or just create a Windows Scripting Host object and perform a sendkey "{END}" command. This should work in that case:

CreateObject("WScript.Shell").SendKeys "{END}"


Set obj = oPage.WebTable("object_Name")
Set objWshShell = CreateObject("WScript.shell")
obj.ChildItem(2,1,"WebEdit",0).Fireevent "onmouseover"
objWshShell.SendKeys "{DOWN}"
objWshShell.SendKeys "{DOWN}"

'This piece of code can be iterated further to find the particular cell you want

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜