Forum Discussion

VernReimer's avatar
VernReimer
New Contributor
8 years ago
Solved

Regexp not found

I am looking for an Add button object, in a Keyword test, who's height can change vary 23 to 24 pixels because of Bootstrap.

 

I'm have written this as a Code Snippet...

 

Sys.Browser("*").Page("*").Find(["ObjectIdentifier","ObjectType","Height"],["add","Button","regexp:23|24"],200).Click();

 

Unfortunately TestComplete doesn't seem to recognize the regular expression and find the object.

 

Is there more I should be doing so it can recognize the regular expression?

  • Hello Vern,

     

    Is the height 23 or 24?

     

    a|b Matches either the a or b character or a group. For example, A|abc matches Abc and abc, but not A. The htm|(ml) pattern matches htm and html, but not htl or ml.
    [ ] Matches any single character specified in brackets. For instance, d[ab]e matches dae or dbe and does not match dwe or dxe. To include the ] character into the search, make it either first, or last character in the range or use \]. For example, []abc], [abc]] or [ab\]cd].

     

    I believe your regex should be "regexp:2[34]" if that is the case

     

    https://support.smartbear.com/testcomplete/docs/reference/misc/regular-expressions.html

2 Replies

  • dnguyen's avatar
    dnguyen
    SmartBear Alumni (Retired)

    Hello Vern,

     

    Is the height 23 or 24?

     

    a|b Matches either the a or b character or a group. For example, A|abc matches Abc and abc, but not A. The htm|(ml) pattern matches htm and html, but not htl or ml.
    [ ] Matches any single character specified in brackets. For instance, d[ab]e matches dae or dbe and does not match dwe or dxe. To include the ] character into the search, make it either first, or last character in the range or use \]. For example, []abc], [abc]] or [ab\]cd].

     

    I believe your regex should be "regexp:2[34]" if that is the case

     

    https://support.smartbear.com/testcomplete/docs/reference/misc/regular-expressions.html

    • VernReimer's avatar
      VernReimer
      New Contributor

      Thank you Danny, that did seem to solve my problem, and it does seem to recognize both 23 and 24 now.