Website if you want to try by your self: https://phptravels.com/ to run the script
<div class="lvl-0 dropdown">
<span>Features</span>
<div class="dropdown-content featuresDropdown">
<a class="lvl-1 link nav-link" href="https://phptravels.com/features">Main Features</a>
<a class="lvl-1 link nav-link" href="https://phptravels.com/hotels-module-features/">Hotels Module</a>
<a class="lvl-1 link nav-link" href="https://phptravels.com/flights-module-features/">Flights Module</a>
<a class="lvl-1 link nav-link" href="https://phptravels.com/tours-module-features/">Tours Module</a>
<a class="lvl-1 link nav-link" href="https://phptravels.com/cars-module-features/">Cars Module</a>
<a class="lvl-1 link nav-link" href="https://phptravels.com/offers-module-features/">Offers Module</a>
<a class="lvl-1 link nav-link" href="https://phptravels.com/blog-module-features/">Blog Module</a>
<a class="lvl-1 link nav-link" href="https://phptravels.com/newsletter-module-features/">Newsletter Module</a>
<a class="lvl-1 link nav-link" href="https://phptravels.com/cms-module-features/">CMS Module</a>
</div>
</div>
public void featureButton()
{
Actions builder = new Actions(webDriver);
IWebElement dropdown = webDriver.FindElement(POM.mainfeature);
IWebElement option = webDriver.FindElement(POM.Option);
Actions hoverClick = builder.MoveToElement(dropdown).Click(option).Click();
hoverClick.Build().Perform();
WaitTime();
}
public void WaitTime()
{
WebDriverWait webDriverWait = new WebDriverWait(webDriver, TimeSpan.FromSeconds(100));
}
public static class POM
{
public static By mainfeature = By.XPath("//*[@class=\"lvl-0 dropdown\"]");
public static By Option = By.XPath("//*[contains(text(),'Main Features')]");
}
ERROR[
Message:
OpenQA.Selenium.WebDriverException : The HTTP request to the remote WebDriver server for URL http://localhost:54020/session/a4d224f68515fa2eba6289d48ae17d71/url timed out after 60 seconds.
----> System.Net.WebException : The request was aborted: The operation has timed out.
Stack Trace:
HttpCommandExecutor.MakeHttpRequest(HttpRequestInfo requestInfo)
HttpCommandExecutor.Execute(Command commandToExecute)
DriverServiceCommandExecutor.Execute(Command commandToExecute)
RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
RemoteWebDriver.set_Url(String value)
RemoteNavigator.GoToUrl(String url)
LogInTest.Test() line 29
--WebException
HttpWebRequest.GetResponse()
HttpCommandExecutor.MakeHttpRequest(HttpRequestInfo requestInfo)]