Sagar007
Sagar007

Reputation: 848

How can I change my xpath dynamically in Selenium WebDriver?

In my application id is changing dynamically,and name is not given to all elements.

Now I want to apply dynamic way of searching "x path" in different Division in HTML. Whenever I refresh page , database value can be added or removed from page.

So is there any way for taking dynamic path of one element??

Upvotes: 0

Views: 1654

Answers (1)

user4506234
user4506234

Reputation:

You can use custom XPath or CSSPath. This path have some condition like "OR", "AND", etc. You can also use some functions like contains(), text(), not(), etc.

References : http://www.w3schools.com/xpath/xpath_functions.asp http://www.w3schools.com/cssref/css_selectors.asp

Upvotes: 2

Related Questions