Issue with LinkText on specific html | Selenium Forum
D
dinesh.decent Posted on 16/01/2019
0
 

html is:<a href="http.someurl.com" class="tango">abc news</a>I want to click on 'abc news' link. I am using linkText as locator but it is not working.Could anyone let me know why linkText is not working in this case?I only want to use linkText as locator no other locator

I am using : By.linkText("abc news")).click();


R
Roohi Khetarpal Replied on 16/01/2019

You can try this //a[contains(text(),'abc news')].click();


A
Ashish Thakur Replied on 23/01/2019

You can implement the suggestion by Roohi, that would work.

 

Let us know, if that doesn't work