Micro Focus QTP (UFT) Forums
QTP - not recognize links that contain "(" or ")" - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Others (https://www.learnqtp.com/forums/Forum-UFT-QTP-Others)
+--- Thread: QTP - not recognize links that contain "(" or ")" (/Thread-QTP-not-recognize-links-that-contain-or)



QTP - not recognize links that contain "(" or ")" - gabif - 12-11-2008

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


RE: QTP - not recognize links that contain "(" or ")" - gabif - 12-11-2008

I found the solution!

To access a link "link (test)" you must type "link \(test\)"


RE: QTP - not recognize links that contain "(" or ")" - Ankur - 12-12-2008

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 \