enter image description hereI am trying to click on a tab - a rather simple task.But, I get the error message above. I have added a thread.sleep command - in case it is due to synchronization issues. Your help is highly appreciated:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using OpenQA.Selenium.Support.UI;
using System.Globalization;
using System.Threading.Tasks;

namespace CV_Lib_Do_Not_Use
    class Program
        static void Main(string[] args)
            //Instantiate Firefox Driver
            //Go to CV Library Website
            var driver = new FirefoxDriver();

            //Wait for web element to become visible

            //Click on Search Jobs tab


I have checked previous errors from:

Selenium webdriver - Unable to locate element,xpath,error

Selenium Webdriver | Unable to locate element error

The solutions were not helpful.

1 Answer 1


There are no elements matching the XPath expression.

There is actually a much simpler way to locate the "Search Jobs" link - by "id":


Note that, instead of Sleep() call, you should use an Explicit Wait:

var wait = WebDriverWait(driver, TimeSpan.FromSeconds(10))
  • That worked!! How did you get "header-link-searchjobs", please ? I can't seem to get it by using firepath / firebug.. Many Thanks
    – OA345
    Jun 28, 2017 at 20:07
  • @OA345 just inspected the element with chrome developer tools. Glad to see it helped. Thanks.
    – alecxe
    Jun 28, 2017 at 20:10
  • I have taken a screen shot of the Chrome Developer. But I could not locate the tag that you suggested earlier. I have attached a screen shot. Please, can you help. Thank you.
    – OA345
    Jun 28, 2017 at 20:34
  • @OA345 interesting, your desired element looks in the page source this way <a href="/search-jobs" id="header-link-searchjobs">Search Jobs</a>. Does it look the same to you?
    – alecxe
    Jun 28, 2017 at 20:37
  • Where exactly in the page / tab are you looking at please ? Can you see the screen shot I attached ? Thank you
    – OA345
    Jun 28, 2017 at 20:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.