title: OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError at WebElement Submit click
body: <p>I'm trying to automate a scenario for some web pages using C#, Selenium and Chrome Webdriver, where Submit button click on the page will submit the sendkeys values.<br>
  however when Submit is clicked, it's throwing an <code>UnpackAndThrowOnError</code> error in Visual Studio Test explorer Window (<code>Nunit</code>).  </p>
  
  <pre><code>    &lt;button type="submit" class="btn btn-primary mr-4" name="postType" value="Submit"&gt;Submit&lt;span class="glyphicon glyphicon-floppy-save"&gt;&lt;/span&gt;&lt;/button&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/IiYri.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IiYri.png" alt="enter image description here"></a></p>
  
  <p>Detailed Error Description:</p>
  
  <pre><code>at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(ResponseerrorResponse)
  at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary'2 parameters)
  at OpenQA.Selenium.Remote.RemoteWebElement.Execute(String commandToExecute, Dictionary'2 parameters)&lt;br&gt;
  at OpenQA.Selenium.Remote.RemoteWebElement.Click()
  at Onrsr.Specflow.Sampletest.occurrence() in C:\Users\manish.sharma\source\repos\Onrsr.Specflow\Onrsr.Specflow\Sampletest.cs:line 180
  </code></pre>
  
  <p>I've tried the below code options, but they all are failing at submitBtnReview.Click()</p>
  
  <pre><code>IWebElement submitBtnReview = driver.FindElement(By.XPath("//button[contains(.,'Submit')]"));
  submitBtnReview.Click();
  
  IWebElement submitBtnReview = driver.FindElement(By.CssSelector("input[value='Submit']"));
  submitBtnReview.Click();
  
  IWebElement submitBtnReview = driver.FindElement(By.XPath("//button[@class='btn btn-primary mr-4']"));
  submitBtnReview.Click();
  
  IWebElement submitBtnReview = driver.FindElement(By.CssSelector("input[type='submit'][value='Submit']"));
  submitBtnReview.Click();
  </code></pre>
  
  <p>I've also tried using <code>submitBtnReview.Submit()</code> with the <code>IwebElement</code> above, however it's crashing the page.</p>
  
  <p>I'm using latest version of Selenium.WebDriver (3.141.0) and Selenium.Chrome.WebDriver (2.43.0), and using chrome version 70.0.3538.102 (Official Build) (64-bit) on windows 10 machine.</p>
  
  <p>Any idea what I might be doing wrong here?</p>
  
  <hr>
  
  <p><strong>[05/12/2018]</strong> - thank you for all valuable feedbacks -  I've now also tried the below and they are failing at <code>submitBtnReview.Click()</code> with a new error:</p>
  
  <p><code>Message: OpenQA.Selenium.WebDriverException : unknown error: Element &lt;button type="submit" class="btn btn-primary mr-4" name="postType" value="Submit"&gt;...&lt;/button&gt; is not clickable at point (1792, 876). Other element would receive the click: &lt;footer class="border-top bg-white"&gt;...&lt;/footer&gt;
    (Session info: chrome=70.0.3538.110)
    (Driver info: chromedriver=2.43.600210 (68dcf5eebde37173d4027fa8635e332711d2874a),platform=Windows NT 10.0.17134 x86_64)</code></p>
  
  <pre><code>IWebElement submitBtnReview = driver.FindElement(By.CssSelector("button[type='submit'][value='Submit'][name='postType']"));
  IWebElement submitBtnReview = driver.FindElement(By.XPath("//button[contains(@class, 'btn') and contains(@class, 'btn-primary') and contains(@class, 'mr-4')]"));
  IWebElement submitBtnReview = driver.FindElement(By.XPath("//button[@class='btn btn-primary mr-4']"));
  IWebElement submitBtnReview =  new WebDriverWait(driver, TimeSpan.FromSeconds(20)).Until(ExpectedConditions.ElementToBeClickable(By.XPath("//button[@class='btn btn-primary mr-4' and @name='postType'][normalize-space()='Submit']")));
  IWebElement submitBtnReview = new WebDriverWait(driver, TimeSpan.FromSeconds(10)).Until(element_is_present(By.CssSelector("button[type='submit'][value='Submit'][name='postType']")))
  
  
  public static Func&lt;IWebDriver, IWebElement&gt; element_is_present(By by)
      { return driver =&gt;
          { IWebElement element = driver.FindElement(by);
              try
              { if (element != null &amp;&amp; element.Displayed &amp;&amp; element.Enabled)
                  { return element;
                  }
                  else
                  { return null;
                  }
              }catch (StaleElementReferenceException)
              { return null;
              }
          };
      }
  </code></pre>
  
  <p>Setting some breakpoints, showing <code>submitBtnReview</code> LocationOnScreen coordinates with a new error, and this might be related.   </p>
  
  <pre><code>    LocationOnScreen = '((OpenQA.Selenium.Remote.RemoteCoordinates)((OpenQA.Selenium.Remote.RemoteWebElement)submitBtnReview ).Coordinates).LocationOnScreen' threw an exception of type 'System.NotImplementedException'
  </code></pre>
  
  <p>Submit button details from debugging:</p>
  
  <p><a href="https://i.stack.imgur.com/f8DWB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/f8DWB.png" alt="enter image description here"></a></p>
  
  <p>Error image:
  <a href="https://i.stack.imgur.com/wbtsP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wbtsP.png" alt="enter image description here"></a></p>
  
  <p>Hope this additional information help finding the cause - thanks in advance!!</p>