Highlighted
282 views

Visual Relation Object via Descriptive Programming in UFT

Hi All,

I want to achieve Visual Relation using Descriptive programming but after going through several forums got to know that it can be achieved totally using DP. It has to be a combination of DP and OR - limitation in UFT.

But just wanted to check if anyone is aware of solution to achieve this totally using Dp

Below are the old pos references

https://community.softwaregrp.com/t5/Unified-Functional-Testing-User/Achieving-Visual-Relation-Identifier-option-using-AOM/m-p/345764#M13585

https://community.softwaregrp.com/t5/Unified-Functional-Testing-User/Achieving-Visual-Relation-Identifier-option-using-AOM/m-p/345763#M13584

For me its working with combination of OR and DP but not totally via DP

below is the code reference of both versions - anyone please let me know if you are aware of the solution.

 

''########## WROKING FINE

Set rc = VisualRelations.Create
Set relation = rc.Add 
JavaWindow("CustomerSelect").JavaStaticText("CusShortNameDescAnchor").SetTOProperty "text""Customer Short Name:"
relation.Relatedobjectpath = "JavaWindow(""CustomerSelect"").JavaStaticText(""CusShortNameDescAnchor"")"       'Both above objects are in OR so its working fine
relation.Relativeposition = micRelLeft
relation.Setargument micrelinline, True

Set des=Description.Create
des("to_class").Value = "JavaEdit"
des("visual relations").Value = rc
JavaWindow("CustomerSelect").JavaEdit(des).set "Testing"
Set relation = Nothing
Set rc = Nothing

'########## WROKING FINE

'################################################ NOT WORKING
Set objVR = VisualRelations.Create
Set objRelation = objVR.Add 
'objRelation.Relatedobjectpath = "JavaWindow(""title:=Customer Select.*"").JavaStaticText(""text:=Customer Short Name.*"")"
objRelation.Relatedobjectpath = ObjectAnchorElement
objRelation.Relativeposition = micRelLeft
objRelation.Setargument micRelInline, True
'relation.RelativePosition = micRelClosestX

Set objJEdit = Description.Create
objJEdit.Add "to_class""JavaEdit"
objJEdit.Add "visual relations", objVR
JavaWindow("title:=Customer Select.*").highlight
JavaWindow("title:=Customer Select.*").JavaStaticText("text:=Customer Short Name.*").highlight
'JavaWindow("title:=Customer Select.*").JavaEdit(objJEdit).highlight
JavaWindow("title:=Customer Select.*").JavaEdit(objJEdit).Set "Superb"

Set objRelation = Nothing
Set objVR = Nothing

################################################ NOT WORKING

 

Thanks in advance

Prakash

0 Likes
2 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

Sorry but I don't think it is possible to combine VR and DP.

0 Likes
Highlighted

Yes we can combime i have dont it and it works fine.

Now i am looking at eliminating the OR completely and achieve the same via DP itself.

Need if anyone knows about the same Or has done it.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.