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
When I click on a link in web page.Link should open in new window.can anyone please let me know the script for this ---Koti
what are the mandatory properties for a tex boxc (scenario?)
Hello, Is there any way to send the test results in html format (or any other) by email using outlook after the test run ends? thank you in advance
How you can decide which type of object repository you have to use?
How to create scenario selector
Explain the difference between check point and output value?
give me an example where u used good judgement and logic in solving a problem
Does quicktest professional is unicode compatible?
How to use conditional loops in qtp ?
How many types of object repository in qtp?
I want to capture data(using keyword) from msdos application using QTP?... Below is little work i could do on it... /* Set app=CreateObject("Wscript.shell") SystemUtil.run ("C:\Users\Agent\Desktop\pumpsim\PUMPSIM.EXE") Window(“PUMPSIM.EXE”).Activate wait(3) app.sendkeys "N" */ Thanks in advance...!!!
Difference between test object and run time object?
Discuss quicktest professional environment?
What is the syntax to call one script from another?
What is QTP scenario.