title: Cast IWebdriver mock object to IJavaScriptExecutor
body: <p>How to convert <code>IWebdriver</code> mock object to <code>IJavaScriptExecutor</code>?</p>
  
  <p>My code: </p>
  
  <pre><code>private Mock&lt;IWebDriver&gt; _mockBrowserDriver;
  _mockBrowserDriver = new Mock&lt;IWebDriver&gt;();
  var jsExecutor = (IJavaScriptExecutor) _mockBrowserDriver;
  </code></pre>
  
  <p>Outcome:</p>
  
  <pre><code>Unable to cast object of type 'Castle.Proxies.IWebDriverProxy' to type 'OpenQA.Selenium.IJavaScriptExecutor'.
  </code></pre>