Monday, July 25, 2011

QTP - Question and Answers - 1

1.  What are the differences between function and action?



Note: It depends on the comfortably/requirement for any person to decide which one is better among Action Vs Function.

2. How can you scroll down or up in a page using QTP?

There are couple of ways for doing this.

'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}"

1 comment:

  1. Hi,
    Useful article.But it's very difficult to read the differences between function and action.

    QTPbook

    ReplyDelete