Micro Focus QTP (UFT) Forums
How To Do a Right Click on a Image in Web Table - 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 Do a Right Click on a Image in Web Table (/Thread-How-To-Do-a-Right-Click-on-a-Image-in-Web-Table)



How To Do a Right Click on a Image in Web Table - RameshKrishnan - 06-28-2013

Hi ,I have a Web Table full of Images(Mobile Apps).

I have to right click on every Image-->View Meta data-->Then get the Updated By Details.

Can some one please help how to do a right click on an Image in Webtable.

And How to loop through a Webtable full of Images.

Code:
data = Browser("name:=Scheduling Week Calendar.*").Page("title:=Scheduling Week Calendar*").WebTable("name:=Previous Week").GetCellData(3,2).

this gives me the name of Image..but how to right click on this image..


RE: How To Do a Right Click on a Image in Web Table - ravi.gajul - 06-28-2013

Please try the code after you get abs_x and abs_y coordinates of the image.
Code:
browser().Page().Image().Click x,y,micRightBtn
If this doesn't work create "mercury.devicereplay" object which can be used to simulate mouse events.
Alternatively simulate the keyboard shortcut for right click using the shell object.


RE: How To Do a Right Click on a Image in Web Table - RameshKrishnan - 07-09-2013

hi ravi ,

I tried this code

Code:
Set obj=Browser("name:=Scheduling Week Calendar.*").Page("title:=Scheduling Week Calendar*").WebTable("name:=Previous Week").Image("image type:=Plain Image","index:=9")
Setting.WebPackage("ReplayType") = 2
obj.RightClick
Setting.WebPackage("ReplayType") = 1

Its working now.

I have one more issue in this script , now say i have 4 images in this Webtable, on rightclick of Image 1 i get a list of link objects (updated By) on click of this i will get the name of updated by.

But for Image 2 && 3 i wont have this updated by link object. Here i want to loop the table only for those images having updated by link object on right click.

I tried following code

Code:
Set obj=Browser("name:=Scheduling Week Calendar.*").Page("title:=Scheduling Week Calendar*").WebTable("name:=Previous Week").Image("image type:=Plain Image","index:=9")
Setting.WebPackage("ReplayType") = 2
obj.RightClick
Setting.WebPackage("ReplayType") = 1
If Browser("name:=Scheduling Week Calendar.*").Page("title:=Scheduling Week Calendar*").Link("name:=View app metadata").Exist Then
msgbox 1
Else
msgbox 2
End IF

Here even if the link View app metadata is not present its showing msgbox 1.Can you help me in this?

Thanks