1
votes

I am facing issue while clicking on dynamic object.I have one link object with below format : 123456789 B &[L] Here value 123456789 getting from excel sheet and B is dynamic value which is may be vary from A to Z. I'm able to click on Link object using regular expression but it is taking huge time to click and getting error 'Object description is mismatch' in report.

Browser("ABC").Page("CBD").Frame("TRIP").Link("123456789 B& [L]").Click

Could you please help me to handle this case in UFT.

1

1 Answers

1
votes

For the dynamically changing property of that link, you can use the regular expression(in the OR):

123456789 [A-Z]& \[L\]

Click for Regex Demo

Explanation:

  • 123456789 - matches 123456789
  • - matches a space
  • [A-Z] - matches a single occurrence of a capital letter
  • & - matches a &
  • - matches a space
  • \[L\] - matches a [ followed by L followed by ]

Update

In case the digits are also not constant, you can use the regex [0-9]+ [A-Z]& \[L\]. Check demo here.