I am running a selenium test using the grid mode. Whenever i am not able to find an element in the page, I am getting the following exception
"The HTTP request to the remote WebDriver server for URL http://localhost:4444/wd/hub/session/5fe58b67-491c-4b72-9a3a-a6dc790cc29d/element timed out after 60 seconds."
I was expecting an exception which is like NoSuch Element found. But I am getting a timeout. Any pointers on this would be much helpful
The code is below
try
{
switch (findBy.ToLower())
{
case "classname":
webElement = driver.FindElement(By.ClassName(findByValue));
break;
case "cssselector":
webElement = driver.FindElement(By.CssSelector(findByValue));
break;
case "id":
webElement = driver.FindElement(By.Id(findByValue));
break;
case "linktext":
webElement = driver.FindElement(By.LinkText(findByValue));
break;
case "name":
webElement = driver.FindElement(By.Name(findByValue));
break;
case "partiallinktext":
webElement = driver.FindElement(By.PartialLinkText(findByValue));
break;
case "tagname":
webElement = driver.FindElement(By.TagName(findByValue));
break;
case "xpath":
webElement = driver.FindElement(By.XPath(findByValue));
break;
}
}
catch (Exception e)
{
return null;
}
Many Thanks