I want to learn how to make customize xpath for selenium java

Arjun Bharadwaj :

I want to learn how to make customize xpath I tried this

//*[@class='btn btn-primary goliveBtn btn-lg float-right']//*[@text()="Go Live"]

but its not working

KunduK :

I got your point.You are probably looking after this.

//*[@class='btn btn-primary goliveBtn btn-lg float-right'][contains(.,"Go Live")]

OR use normalize-space

//*[@class='btn btn-primary goliveBtn btn-lg float-right'][normalize-space(text())='Go Live']

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=156745&siteId=1