title: Why I'm getting StaleElementReferenceException on just retrieved elements by Driver.FindElementsByCssSelector();
body: <p>I use edge webdriver to find element on page (SPA), and immediately simulate click.</p>
  <p>However, I'm getting OpenQA.Selenium.StaleElementReferenceException: stale element reference: element is not attached to the page document.</p>
  <p>In case the element was rerendered by the SPA framework between finding element and clicking, I've added some retry logic, but I'm still getting the error.</p>
  <pre><code>IWebElement FirstCell =&gt; Driver.FindElementsByCssSelector(&quot;.simple-grid .sg-row&gt;.sg-cell&quot;).FirstOrDefault();
  
  
  void Test()
  {
    try 
    {
      FirstCell.Click();
    }
    catch (StaleElementReferenceException)
    {
      FirstCell.Click(); //retry - this should find element againand return new instance
    }
  }
  </code></pre>
  <p>Notice, that in the retry block I get fresh element reference</p>