Scroll operations on a webpage using QTP

3,186 views
Skip to first unread message

Venkat Kandula

unread,
Oct 30, 2013, 10:41:26 AM10/30/13
to mercu...@googlegroups.com
Hi Google groups,

How should we scroll down, up, right and left operations on a webpage using QTP.

I tried in so many ways getting following error

Object doesn't support this property or method

a).

Browser(" ").Page(" ").parentwindow.scrollby 0,1280

b).

Set Oscroll=Browser("micclass:=Browser").Page("micclass:=Page").Object.Body

Oscroll.doScroll("pageLeft")

Set Oscroll=Nothing

Please let me know if any one have idea about scroll operations.


Thanks,
Venkat

Shantanu Joshi

unread,
Nov 3, 2013, 5:54:42 AM11/3/13
to mercu...@googlegroups.com
Hi Venkat,

Wish You A Very Happy Diwali!!!!

Answer to your problem can be as below:

Let me put a scenario before you which can help you understand.

Scenario : I assume you want to scroll down a webpage.

Answer:

You can use WSH Object and sendkeys method provided by QTP.

Use following code.

Browser("Citibank India Home").Page("Citibank India Home").Highlight

Set objShell=CreateObject("WScript.Shell")
objShell.SendKeys "{PGUP}"
objShell.SendKeys "{PGDN}"
objShell.SendKeys "{END}"


This will scroll up/down your page.

Else

If you want to scroll a webtable then use Object.Fireevent "onmousedown" property in qtp.

Thanks!!!

Enjoy Automation,
Shantanu

surabhi

unread,
Nov 4, 2013, 4:17:03 PM11/4/13
to mercu...@googlegroups.com
You can use "FireEvent {KeyUP}" and then use middle clicks or x-y clicks!
Reply all
Reply to author
Forward
0 new messages