0

I'm having trouble capturing the regex in xpath for list of web elements in Selenium Web driver automation.

I have new, change, old tabs on the page.

//a[@data-target='#newFieldsTab']

I tried match but it didn't worked.

Eg:

//a[matches(@data-target='FieldsTab')]

1 Answer 1

2

You can achieve this by using the xPath expression

//a[contains(@data-target,'FieldsTab’)]

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.