06-23-2013, 07:20 PM
Hi experts,
I'm new to QTP DP and I'm having issues in object identification using Visual Relations. However the same is working fine with establishing relationship in OR.
Please see the attached image. There is a "Date of Last Update:" label, followed by a date as label. These two labels are available in TD elements of a HTML table.
With the below code, I'm expecting to locate the actual date value in the page (i.e., extract last update date from the page for further processing). However, I'm getting the below code.
==================== ERROR MESSAGE ================
Cannot identify the object "[ WebElement ]" (of class WebElement). Verify that this object's properties match an object currently displayed in your application.
Line (41): "Browser("title:=.*").Page("title:=.*").WebElement( desc2).highlight".
Tip: If the objects in your application have changed, the Maintenance Run Mode can
help you identify and update your steps and/or the objects in your repository.
=================================================
Line 41 is the last line in the below code snippet. Until this line, I'm getting the results as expected; i.e., the table cells are properly highlighted.
Even if I have removed the "relation1", I'm still getting the same error.
I have also tried to provide the below to the RelatedObjectPath property of relation & relation1 objects.
Existing:
New:
... but still I'm getting the same error.
Could any one please review and let me know what mistake I made that prevented me getting the expected behaviour?
As a side node: Is this the right approach to extract data using DP? Or are there any other methods that can be used?
Many thanks in advance.
Regards,
Hari
I'm new to QTP DP and I'm having issues in object identification using Visual Relations. However the same is working fine with establishing relationship in OR.
Please see the attached image. There is a "Date of Last Update:" label, followed by a date as label. These two labels are available in TD elements of a HTML table.
With the below code, I'm expecting to locate the actual date value in the page (i.e., extract last update date from the page for further processing). However, I'm getting the below code.
==================== ERROR MESSAGE ================
Cannot identify the object "[ WebElement ]" (of class WebElement). Verify that this object's properties match an object currently displayed in your application.
Line (41): "Browser("title:=.*").Page("title:=.*").WebElement( desc2).highlight".
Tip: If the objects in your application have changed, the Maintenance Run Mode can
help you identify and update your steps and/or the objects in your repository.
=================================================
Line 41 is the last line in the below code snippet. Until this line, I'm getting the results as expected; i.e., the table cells are properly highlighted.
Code:
Dim desc1, desc2, desc3
Set desc1 = Description.Create
desc1( "innertext").Value = "Date of Last Update:"
desc1("html tag").value= "TD"
Set desc3 = Description.Create
desc3( "innertext").Value = "Updated By:"
desc3("html tag").value= "TD"
Browser("title:=.*").Page("title:=.*").WebElement(desc1).highlight
Browser("title:=.*").Page("title:=.*").WebElement(desc3).highlight
Dim VisualRel, relation, relation1
Set VisualRel = VisualRelations.Create
Set relation = VisualRel.Add
relation.RelatedObjectPath = "Browser(""title:=.*"").Page(""title:=.*"").WebElement(desc1)"
relation.relativeposition = micRelLeft
relation.setargument micRelInline, True
Set relation = Nothing
Set relation1 = VisualRel.Add
relation1.relatedobjectpath = "Browser(""title:=.*"").Page(""title:=.*"").WebElement(desc3)"
relation1.relativeposition = micRelRight
relation1.setargument micRelInline, False
Set relation1 = Nothing
Set desc2 = Description.Create
desc2("innertext").Value = ".*"
desc2("html tag").value= "TD"
desc2("Visual Relations").Value = VisualRel
Browser("title:=.*").Page("title:=.*").WebElement( desc2).highlight
Even if I have removed the "relation1", I'm still getting the same error.
I have also tried to provide the below to the RelatedObjectPath property of relation & relation1 objects.
Existing:
Code:
relation.RelatedObjectPath = "Browser(""title:=.*"").Page(""title:=.*"").WebElement(desc1)"
Code:
relation.RelatedObjectPath = "Browser(""title:=.*"").Page(""title:=.*"").WebElement(""innertext:=Date of Last Update:"", ""html tag:=TD"")"
... but still I'm getting the same error.
Could any one please review and let me know what mistake I made that prevented me getting the expected behaviour?
As a side node: Is this the right approach to extract data using DP? Or are there any other methods that can be used?
Many thanks in advance.
Regards,
Hari