Micro Focus QTP (UFT) Forums
How to right click on webpage using QTP? - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: How to right click on webpage using QTP? (/Thread-How-to-right-click-on-webpage-using-QTP)



How to right click on webpage using QTP? - QTP trainee - 03-14-2013

Hi, I have to right click on webpage...Can anyone help me out here with some code?


RE: How to right click on webpage using QTP? - basanth27 - 03-15-2013

What is the object you are trying to right click on? Is it just on the page?
Something I could remember of...
Method 1:
Code:
Setting.WebPackage("ReplayType") = 2
browser().page().webelement().Click ,,micRightBtn
'Setting.WebPackage("ReplayType") = 1 'Default 1

Method 2:
Code:
Set obj = CreateObject("mercury.devicereplay").
getX = webElem.GetROProperty("abs_x")
getY = webElem.GetROProperty("abs_y")

obj.MouseClick getX, getY,RIGHT_MOUSE_BUTTON

And then there is the crude way...But you have to find your way through it..the below is the clue to the puzzle Smile
Code:
Extern.Declare micVoid, "mouse_event", "user32.dll", "mouse_event", micLong, micLong, micLong, micLong, micLong