Micro Focus QTP (UFT) Forums
Right click on java text in 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: Right click on java text in QTP (/Thread-Right-click-on-java-text-in-QTP)



Right click on java text in QTP - Pkapoor - 07-05-2013

Hello ,

I have a java tree and various options under it to choose from ..I have to right click on java text under this java tree. When i record QTP gives following code:
Code:
JavaWindow("Management").JavaTree("ApplianceTree").Select "root;All;172.25.12.45"
JavaWindow("Management").JavaTree("ApplianceTree").Click 96,22,"RIGHT"

But value 96 and 22 vary and test case fails at times.
How can i get the absolute location to click?

I was trying to use following code but was not successful:
Code:
Set pathObj = (JavaWindow(" Management").JavaObject("JScrollPane").Select  "root;All;xxx.xx.xx.xx")
Set obj = CreateObject("Mercury.DeviceReplay")
getX = pathObj.....  
'trying to get x and y coordinated and get to use right click method but getObj does not come with any function so that i can click on text and do right click

Can anyone suggest me the code to use? I am stuck