title: Selenium: Click timeout on opening of modal dialog
body: <p>Currently I am automating an editor within a CMS, which includes a wide choices of options such as inserting links and changing the text color.</p>
  
  <p>The issue I am facing is that upon clicking one of the toolbar buttons, a javascript command is executed launching a modal dialog</p>
  
  <p>for some reason this modal dialog box causes my code to hang on the click command until it either has been manually closed or the click times out after 60 seconds</p>
  
  <p>Here is a sample of my code</p>
  
  <pre><code>try
  {
       // the click that opens the modal dialog
       driver.FindElement(By.Id("CreatArticle")).Click();
  
       // the code then hangs on the click command above until
       //it times out or the modal dialog is manually closed
       System.Windows.Forms.MessageBox.Show("This message box never shows");
  }
  catch(exception e)
  {
       //this writes the exception to an error log
       testLog("Page creation failed, reason: " + e);
  }
  </code></pre>
  
  <p>The exception message I recieve</p>
  
  <pre><code>&gt; Article creation failed, reason: OpenQA.Selenium.WebDriverException:
  &gt; The HTTP request to the remote WebDriver server for URL
  &gt; http://localhost:63377/session/adde8cea404a930e9086e1782afcbcf5/element/0.03468421520665288-16/click
  &gt; timed out after 60 seconds. ---&gt; System.Net.WebException: The
  &gt; operation has timed out    at System.Net.HttpWebRequest.GetResponse() 
  &gt; at
  &gt; OpenQA.Selenium.Remote.HttpCommandExecutor.CreateResponse(WebRequest
  &gt; request) in
  &gt; c:\Projects\webdriver\dotnet\src\webdriver\Remote\HttpCommandExecutor.cs:line
  &gt; 142    --- End of inner exception stack trace ---
  </code></pre>
  
  <p>I have also tried to click the toolbar button via a js.executeScript() command and was greeted with the same results, however the exception was "execute timed out after 60 seconds".</p>
  
  <p>One option I have been suggested is multithreading, with the second thread handling the dialog box whilst the initial thread is hanging. Is selenium capable of this or is there another approach I can try?</p>
  
  <p>EDIT
  Here is an example i have found of my issue
  <a href="https://developer.mozilla.org/samples/domref/showModalDialog.html" rel="nofollow">https://developer.mozilla.org/samples/domref/showModalDialog.html</a></p>