Micro Focus QTP (UFT) Forums
How to automate Right click on image? - 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: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: How to automate Right click on image? (/Thread-How-to-automate-Right-click-on-image)



How to automate Right click on image? - Kartikraman - 07-12-2010

How to automate Right click on image to set certain actions like saving the picture.


RE: How to automate Right click on image? - basanth27 - 07-12-2010

Do sendkeys help ?


RE: How to automate Right click on image? - Arun Prakash - 07-12-2010

Hi,

First add that image to object repository then use the below code

Code:
Set WshShell = CreateObject("WScript.Shell")
Browser("").Page("").Image("").Highlight
WshShell.SendKeys "+{F10}"

Now the context menu will open,if that is not getting identified properly by QTP, use low level recording we will get similar code which is given below..

Code:
'Press down arrow
Window("").WinObject("").Type micDwn
Window("").WinObject("").Type micDwn
Window("").WinObject("").Type micDwn
'Press on enter
Window("").WinObject("").Type micReturn


hope this will solve your problem..