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 rep
Unfortunately there's no string wildcards in XPath. However you can use multiple contains()
and starts-with()
to filter things like this.
//input[starts-with(@id, 'activation:') and contains(@id, ':voId:1')]
Also, this answer could be useful too: selenium: Is it possible to use the regexp in selenium locators
You can use string wildcards using the matches
function which is available in XPath 2.0:
//input[matches(@id, 'activation:.*:voId:1')]