Search code examples
hp-uft

UFT: Not Clicking the Listitem that has brackets in it


Browser("Create case").Page("Create case").WebElement("innertext:="&SubCategoryExcel ,"index:=1").Click

In the above code Webelement is actually a custom drop down. its working fine all the innertext that I am passing to it. But when an innertext has brackets in it. it doesn't work. e.g: innertext:=issues (waiting for communication from primary or secondary decoder)


Solution

  • In descriptive programming the value is treated as a regular expression. Therefore you need to escape special characters by putting a backslash before them Try the following value

    issues \(waiting for communication from primary or secondary decoder\)