10-21-2011, 04:09 PM
Hi viclassic,
I was just asking u the screenshot of the object spy window to know how QTP is recognising the link. This way it would be better for me to give exact resolution.
However, since u haven't posted the screenshot, i will give the resolution as per my understanding.
Add the object(Link) in the OR and use regular expression for the text value of the link(as the text/name of the link is changing dynamically). U will see an icon(something like <#>), click on the icon. Once u click on the icon, a pop up will appear. There will be a check box named regular expression. Check the chekbox and enter .* in the text field.
Once u r done with the above setting, U can use the below code to get the displayed text of the link.
here strLinkName will have the name of the link dispalyed. This name u can use for ur rest of the requirement.
I hope this would serve ur purpose.
Do let me know if it does not work.
Regards,
Ankesh
I was just asking u the screenshot of the object spy window to know how QTP is recognising the link. This way it would be better for me to give exact resolution.
However, since u haven't posted the screenshot, i will give the resolution as per my understanding.
Add the object(Link) in the OR and use regular expression for the text value of the link(as the text/name of the link is changing dynamically). U will see an icon(something like <#>), click on the icon. Once u click on the icon, a pop up will appear. There will be a check box named regular expression. Check the chekbox and enter .* in the text field.
Once u r done with the above setting, U can use the below code to get the displayed text of the link.
Code:
strLinkName=Browser(<Browser>).Page(<page>).Link(<Link Name as per OR>).GetROProperty("text")
here strLinkName will have the name of the link dispalyed. This name u can use for ur rest of the requirement.
I hope this would serve ur purpose.
Do let me know if it does not work.
Regards,
Ankesh