Micro Focus QTP (UFT) Forums

Full Version: QTP - not recognize links that contain "(" or ")"
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I have a problem with the links that contain "(" or ")".
I use next vbscript code:

Code:
link = "link (test)"
Set obj_DescAssert = Description.Create
obj_DescAssert("name").value= link
NameToUse = "name:="+link
Browser(BrowserName).Page(TitlePageName).Link(NameToUse).Exist

In this case the QTP do not recognize the link.
If I use:
link = "link test"
everything work OK.

Do you have any idea how to resolve this issue?

Thannks
I found the solution!

To access a link "link (test)" you must type "link \(test\)"
The reason is "(" & ")" are used for creating regular expressions. To treat them as literal characters, we need to append an escape character before them. This escape charatcer is \