-3

I am trying to find an element on page using xpath but every time I am getting element not found what's wrong here kindly suggest

Url - https://multi-verse-js.herokuapp.com/main.html

Xpath Value I am using for query -  xpath: //a[@class='active'][text()='Web-Search']

Element name I am searching - Web-search

2 Answers2

2

//a[@class='active'][text()='Web-Search'] is finding/selecting nothing from the webpage that's why you are getting element not found

But the following example select element:

//a[contains(.,'Web-Search')]
Md. Fazlul Hoque
  • 15,806
  • 5
  • 12
  • 32
1

You can use partial linkText

partial Linktext: Web-Search 
xPath = //a[contains(text(), 'Web-Search')] 
Ketan Pardeshi
  • 516
  • 1
  • 5
  • 8