Here is the scenario. I am using a random number to create an email. It will be in a list with a '+' next to it in a grid. All rows will have the '+' and then the email address in line to the right. I need to expand down the '+' to verify that an email was sent to the email address with the random number. Not only do I not know the email address because of the random number, it can be anywhere in the list - first, last, or anything in between. This means I can't rely on index.
My plan - Both of these items are WEBELEMENTS. I want to create the '+' WEBELEMENT and use the email as a Visual Relation identifier in the script.
I can create the object for the email no problem. I am having problems getting the visual relation added to the '+'. I may have been looking at this too long as well so sorry if it is a minor mistake I am overlooking. I need to remember to blink! :-)
Here the script - I set the email for testing:
------------------------------------------------------------------------
Sorry if this is a little simple for this forum. I am stuck and relatively new to QTP. Thanks in advance!
Okay, according to QTP's help files, you can't do this. You must have the object in the object repository to use it as a visual relation identifier.
New plan. Use existing object - add the WEBELEMENT for the email, but update the innertext value. This would make the object on the correct row.
Now, how do I update the object values via the script... back to research. But, any suggestions, please let me know.
Thanks!
My plan - Both of these items are WEBELEMENTS. I want to create the '+' WEBELEMENT and use the email as a Visual Relation identifier in the script.
I can create the object for the email no problem. I am having problems getting the visual relation added to the '+'. I may have been looking at this too long as well so sorry if it is a minor mistake I am overlooking. I need to remember to blink! :-)
Here the script - I set the email for testing:
Code:
Dim sEmail
Dim oDesc 'Description Object
Dim colObject 'Object Collection
sEmail="john214@smith.com"
Set oDesc = Description.Create
oDesc( "micclass" ).value = "WEBELEMENT"
'Additional property- for more focused and controlled collection
oDesc( "Innertext" ).value = sEmail
Set colObject = Browser("title:=MYTITLE").Page("title:=MYTITLE").ChildObjects(oDesc )
Dim oVisualRelation, oRelationToElement, oElementDesc,colobject2
Set oVisualRelation = VisualRelations.Create
Set oRelationToElement = oVisualRelation.Add
oRelationToElement.relatedobjectpath = "Browser(""title:=MYTITLE"").Page(""title:=MYTITLE"").ChildObjects(oDesc )"
oRelationToElement.relativeposition = micRelLeft
oRelationToElement.setargument micRelInline, True
Set ElementDesc = Description.Create
ElementDesc("micclass").Value = "WEBELEMENT"
ElementDesc("visual relations").Value = VisualRelation
Set colobject2 = Browser("title:=MYTITLE").Page("title:=MYTITLE").ChildObjects(ElementDesc)
colobject2(0).Highlight
------------------------------------------------------------------------
Sorry if this is a little simple for this forum. I am stuck and relatively new to QTP. Thanks in advance!
Okay, according to QTP's help files, you can't do this. You must have the object in the object repository to use it as a visual relation identifier.
New plan. Use existing object - add the WEBELEMENT for the email, but update the innertext value. This would make the object on the correct row.
Now, how do I update the object values via the script... back to research. But, any suggestions, please let me know.
Thanks!