Sunday, 4 January 2015

How to perform Page Scroll using QTP


Way 1:- How to perform Page Scroll using QTP

object .doScroll(“Scrollingaction”)

Scrolling Actions:

1.Up

2.down

3.pageUp

4.pageDown

5.pageLeft

6.pageRight and many more….

Function Scroll()

Browser(“micclass:=Browser”).Page(“micclass:=Page”).Sync

Set oDoc=Browser(“micclass:=Browser”).Page(“micclass:=Page”).Object.Body

oDoc.doScroll(“pageDown”)

Set oDoc=Nothing

End Function


Way 2:- How to perform Page Scroll using QTP 

'For page up

Set Obj=Browser("browsername").Page("pagename").Object.body

Obj.doScroll("pageUp")

'For page down

Set Obj=Browser("browsername").Page("pagename").Object.body

Obj.doScroll("pageDown")


Or you can also the following Send Keys method:

'For page up

Set objShell=CreateObject("WScript.Shell")

objShell.SendKeys "{PGUP}"


'For page down

Set objShell=CreateObject("WScript.Shell")

objShell.SendKeys "{PGDN}"

No comments:

Post a Comment