user1728406
user1728406

Reputation: 257

Using regular expression for element which has changing numbers in between xpath

In my application I have mails in the inbox and every mail has a different ID. Im not able to click on the first mail as the mail id keeps on changing everytime.

The xpath is as follows:

//*[@id='r1295']/td[4]/a/font

In the above xpath the numbers after 'r...' keep on changing.

How to handle such changes.

Upvotes: 2

Views: 866

Answers (1)

kev
kev

Reputation: 161674

Try xpath function:

//*[starts-with(@id, 'r')]/td[4]/a/font

Upvotes: 3

Related Questions