title: Locating an HTML button element without i.d or class name using selenium web driver
body: <p>Web driver couldn't find the x icon (Close) I used XPath and Full XPath to locate the x icon. Here's my code so far:</p>
  <pre><code>       webDriver.FindElement(By.XPath(&quot;*[@id='root']/div/div/div[1]/button&quot;)).Click();
  </code></pre>
  <p>I copied this <code>*[@id='root']/div/div/div[1]/button</code> by inspecting the element. The error displayed after running the automation testing is this:</p>
  <p><a href="https://i.stack.imgur.com/J9LJg.png" rel="nofollow noreferrer">Error screenshot</a></p>
  <p>I also tried to use Katalon Studio to check if I could get the XPath, it did generate the XPath, but, once I pasted it, it's not working as well.</p>