X PATH query | Selenium Forum
M
Posted on 02/01/2016
on login in gmail :
https://mail.google.com/mail/u/0/#inbox


we have compose button

driver.findElement(By.xpath("//*[@class='z0']/div")).click(); is working

but please let me know what's wrong in below xpath

//*[@text()='COMPOSE'

screenshot attached

M
Replied on 03/01/2016

[quote:2saftoms]//*[@class='z0']/div[/quote:2saftoms]
this xpath is unstable. above xpath will keep on changing.

use this xpath

driver.findElement(By.xpath("//div[text()='COMPOSE']")).click();