Unable to locate a search suggestion element Selenium C#



  • enter image description here

    Hi, I am trying to locate and click on the element that comes up in the search box when I type some name. Can someone please help me out to find & click on the name? I've use searching by XPath - contains(@class, '...'); contains(text()) etc, but everytime it fails.

    When I inspect the element, I see this HTML: enter image description here



  • Use Action class and move to the search suggestions element first then perform your action.

    Actions action = new Action(driver);
    action.MoveToElement("Locator of the element").Perform();
    

    Use the above method to try accessing the search suggestion element.



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2