Search if a button has a particular word using Verifytext? Not exact match

I want to check if a particular button has the word “Start” (usually a variation of Start + some number).

From what I tried:
Verifyelementpresent wouldn’t work because I just want to check if a specific button has that word, not the entire site.
Verifytext hasn’t worked because it does exact matching, and not partial matching.

Am I correct? Is there a way to check if a particular button has a specific word/phrase in it?

you can try sourceSearch or sourceExtract command
like this:
“Command”: “sourceSearch”,
“Target”: “regex=Start\d*”,
“Value”: “”,
“Description”: “”

Problem with this is that “Start” appears in multiple places, and I only want to check if it’s in a particular button.

I see that the button has a source code of

  • Would there be a way to check if the button has “tab-item col item-start” as an identifier?

  • I also tried using click/xclick with the “contains” modifier, but not sure if I’m using it correctly. The button is usually in either two positions:


    The id’s are the same, so I tried to use class instead since one says

    <li data-v-1c342db1="" class="tab-item col item-start">
    <li data-v-1c342db1="" class="tab-item col item-benefits">

    I used //*[@id="main-content"]/div/section[1]/nav/ul/*[contains(@class,"start")] but it couldn’t find anything - is this a syntax error, or does it only work for id’s?

    can you offered the website link or url

    You can try to search “xpath contains”