Ask a Question

REGEX in wndCaption

David91
Frequent Contributor

REGEX in wndCaption

Hi,

 

how i do regex in wndCaption field in NameMapping??

 

I have one button with two other title... title1 - Odhlášení and title 2 - Odhlásiť

 

I need regex to wndCaption for this button title, i used regex OR  Odhlášení|Odhlásiť but TestComplete no find my button 😞

 

Please help, thank you.

 

 

2 REPLIES 2
tristaanogre
Esteemed Contributor

I'm not sure how regex and NameMapping works together.  Documentation says that they are supported but I can't find examples.

However, instead, since the button could have either title, consider using Conditional NameMapping.

https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/name-mapping/mana...


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
AlexKaras
Champion Level 3

Hi,

 

As Robert wrote, Conditional NameMapping should work.

Or just try "Odhlá*" for wndCaption (without quotes).

 

If you like to make one more try with regex for NameMapping, try to put this (exactly as provided) for the wndCaption:

regexp:(Odhlášení)|(Odhlásiť)


P.S. Note, that regex search has significantly lower performance, thus, if you really need it, try to make search depth as short as possible.

Regards,
  /Alex [Community Champion]
____
[Community Champions] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Champions]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
cancel
Showing results for 
Search instead for 
Did you mean: