hi i have one issue while automating the script using QTP i
want scrool down .i cannot do even using scrool down
methqad is not working .the object will take WebElement plz
is there any code help me

Answer Posted / mohd ikhlaque

HI

I have tried the Mouse wheel UP/Down movement operation for
a Windows application , and it is working pretty fine.

Please find the code-snipt for the above mentioned
operation.


'*********************************************************
Function To Perform Mouse Scroll Wheel Operation
****************************************************
*******************
'Function Name :
MouseWheelRotation(iClicks)

'Description :
Performs Mouse Scroll Wheel Operation

''Parameters :
1.iClicks :: No. of Mouse Click
'

'Return Value :
TRUE \ FALSE

'Pre-requisite : Nx
should be launched

'Examples :
Call MouseWheelRotation(-2) -----> To perform
Scroll Down
'
Call
MouseWheelRotation(2) -----> To perform Scroll UP

'History :
' Developer Name

Date
Rev. No.

Reviewer
'-----------------------------------------------------------
------------------------------------------------------------
------------------------------------------------------------
-
' Mohd Ikhlaque

31/05/ 2012
1.0

'-----------------------------------------------------------
------------------------------------------------------------
------------------------------------------------------------
-

'*********************************************************
Start of Function
****************************************************
******************

Public Function MouseWheelRotation(iClicks)
dim iLoop
dim bPos
Window("NXWindow").Window("WinDrawingArea").WinObject
("WinDrawingArea").click 1,1 '======= The Object on which
Mouse wheel operation is to be perform.===========
Wait(2)
MouseWheelRotation=False
Extern.Declare
micVoid, "mouse_event", "user32.dll", "mouse_event",
micLong, micLong, micLong, micLong, micLong
Const MOUSEEVENTF_WHEEL = 2048 '@const long |
MOUSEEVENTF_WHEEL | middle button up
Const POSWHEEL_DELTA = 120 '@const long | POSWHEEL_DELTA |
movement of 1 mousewheel click Down<nl>
Const NEGWHEEL_DELTA = -120 '@const long | NEGWHEEL_DELTA |
movement of 1 mousewheel click Up<nl>

If iClicks<>0Then
For iLoop = 1 to abs(iClicks)
If iClicks > 0 then
'========To Scroll Down=============
Extern.mouse_event
MOUSEEVENTF_WHEEL,0,0,POSWHEEL_DELTA,1
' "Performed Mouse Wheel Down
Operation Successfully "
MouseWheelRotation=True
else
'===========To Scroll
UP===============
Extern.mouse_event
MOUSEEVENTF_WHEEL,0,0,NEGWHEEL_DELTA,1
' "Performed Mouse Wheel UP
Operation Successfully "
MouseWheelRotation=True
end if
next
else
' "Fail :Fail To Perform [Mouse Wheel UP/Down]
Operation"
End If
End Function

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to find the length of the string in qtp?

578


What is the file extension of the code file in qtp?

560


Have you used xml check point in your project? How?

549


Hai anyone please "Explain about Framework in QTP?"

1621


1.Qtp suppots Unix& linx or not 2why qtp suppots shell script.

1678






Can anyone help.i need total excelsheet operations,shortcuts in testing environment from starting onwards....

1428


suppose in the middle of the project QTP will not work properly, then what do u do? and ur team?

1328


How to associate shared object repository to test in qtp?

505


Consider one application is open, clicking one menu will open another application in another browser. QTP does not catch the URL of the second browser(second application). can we capture it ?

1471


how u will evaluate the tool for test automation?

1370


What are metrics and matrix?

1367


If the objects hierarchy is changing from build to build, then how you will handle that condition?

619


How can we use the "CreateObject("Shell.Application")" in QTP and what is the definition and purpose of it?

3058


What kind of performance is expected on the client side (e.g., how fast should pages appear, how fast should animations, applets, etc. load and run)?

598


How to modify the text checkpoint?

616