Join 500+ Software Testing professionals. Solve problem and get your problem solved. Register Now!

Selenium XPath regular expression for an expression starting with certain String.

Solved 1 Answers 202 Views
0 1

I have an element on a web page where its ID is,


 As you can see, it starts with comments-task. How to write a XPath regular expression to identify that?

1 Answer

Best answer
Here is the Regular Expression. Find the path by using 'Contains' keyword

//*[contains(@id, 'comments-task')]/div/div/div[3]/div[2]/form/button
answered by (91 points)
selected by

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.