I want to use Wildcards in my attributes. For example, this is my regular XPath:
//input[@id='activation:j_idt84:voId:1']`
I want to replace the j_idt number with a wildcard because the number is dynamic. I’m looking for something like this:
//input[@id='activation:*:voId:1']
I don’t know how to solve that issue. Is my idea even possible?
Unfortunately there’s no string wildcards in XPath. However you can use multiple
contains()andstarts-with()to filter things like this.Also, this answer could be useful too: selenium: Is it possible to use the regexp in selenium locators