I have the following code to click on a button. When I debug it, it goes past the Click() line, and the button is clicked (I can see a new window popping up as expected). However, it then just sits there for a minute, then returns with a time out exception. It doesn't go to the next line of code.
Also, this seems to happen only for this button where a new pop-up window is launched after it's clicked. Other buttons on the page seem to be fine.
Thanks in advance for any insight!
var button = DriverFactory.Instance.FindElement(By.Id("ctl07_Customers_OCS_ListForms_btnAddCustomer"));
button.Click(); // A new pop-up window is opened
// Next line of code - It times out before it can hit the following line
DriverFactory.Instance.SwitchTo().Window(DriverFactory.Instance.WindowHandles.Last());
Exception Details:
OpenQA.Selenium.WebDriverException was unhandled by user code HResult=-2146233088 Message=The HTTP request to the remote WebDriver server for URL http://localhost:7055/hub/session/5e7fc81a-ed31-4310-9419-f1e5cc0d1b35/element/%7B96a49e56-d619-4765-b0a7-222f69da23bf%7D/click timed out after 60 seconds. Source=WebDriver StackTrace: at OpenQA.Selenium.Remote.HttpCommandExecutor.CreateResponse(WebRequest request) at OpenQA.Selenium.Remote.HttpCommandExecutor.Execute(Command commandToExecute) at OpenQA.Selenium.Firefox.FirefoxDriverCommandExecutor.Execute(Command commandToExecute) at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters) at OpenQA.Selenium.Remote.RemoteWebElement.Click() at OCSPortalFramework.Pages.BankPortal.ListFormsPage.ClickAddCustomer() in C:\Src\EPSQA\Regression_Portals\OCSPortal\OCSPortalFramework\Pages\BankPortal\ListFormsPage.cs:line 25 at OCSPortalTests.OCS_146710_Add_Customer.OCS_146710_Add_Customer_Test() in C:\Src\EPSQA\Regression_Portals\OCSPortal\OCSPortalTests\OCS_146710_Add_Customer.cs:line 52 InnerException: HResult=-2146233079 Message=The request was aborted: The operation has timed out. Source=System StackTrace: at System.Net.HttpWebRequest.GetResponse() at OpenQA.Selenium.Remote.HttpCommandExecutor.CreateResponse(WebRequest request) InnerException: