sridhar249
3 years agoOccasional Contributor
Regularexpression during findChild does not seem to work.
Hi,
I am trying to find a Panel on the page with the following outerHTML.
<div role="group" aria-roledescription="offer" aria-label="Fibre+ Gig Plan Card" class="c-card c-card--odd-number-of-cards">
Here is the regular expression that works.
page.findChild(['ObjectType', 'className', 'outerHTML'],['Panel', 'c-card*', 'regexp:<div role="group" aria-roledescription="offer" aria-label="Fibre+.*'],100)
Here is the regular expression that does not work: (notice the space after Fibre+)
page.findChild(['ObjectType', 'className', 'outerHTML'],['Panel', 'c-card*', 'regexp:<div role="group" aria-roledescription="offer" aria-label="Fibre+ .*'],100)
i even tried the following, but no luck. (notice that i used \b instead of the space. According to the documentation here Regular Expressions Syntax | TestComplete Documentation (smartbear.com) \b Matches a whitespace character. I even tried \s instead of \b but no luck.) So, the following did not work.
page.findChild(['ObjectType', 'className', 'outerHTML'],['Panel', 'c-card*', 'regexp:<div role="group" aria-roledescription="offer" aria-label="Fibre+(\b).*'],100)
page.findChild(['ObjectType', 'className', 'outerHTML'],['Panel', 'c-card*', 'regexp:<div role="group" aria-roledescription="offer" aria-label="Fibre+(\s).*'],100)
Please help.