doneright
doneright

Reputation: 111

help needed with xpath and selenium

selenium IDE gave me following xpath for string on page called "System". However this string may appear somewhere other than this place in future.

//ul[@id='idCTree_sor_ul']/li/ul/li[23]/span

how can I rewrite above xpath by spcifying text()="System" in xpath , so in future if index of that string is moved would not impact on my xpath

Upvotes: 1

Views: 484

Answers (1)

Matthew Flaschen
Matthew Flaschen

Reputation: 285037

//span[./text() = 'System']

Upvotes: 1

Related Questions