I 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();
driver.Navigate().GoToUrl("https://www.cv-library.co.uk/");
//Wait for web element to become visible
System.Threading.Thread.Sleep(15000);
//Click on Search Jobs tab
driver.FindElement(By.XPath(".//*[@id='header-nav-new']/div/div[2]/ul/li[2]/a")).Click();
}
}
}
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.