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')]

2

You can achieve this by using the xPath expression

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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