title: Button not clickable once exiting the iFrame
body: <p>I am trying to automate a payment using selenium java via a modal. I am able to enter the CC details however when I exit the iframe to click the pay button nothing happens and I get an error in the console.</p>
  <pre><code>Exception in thread &quot;main&quot; org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element: {&quot;method&quot;:&quot;xpath&quot;,&quot;selector&quot;:&quot;//*[@id=&quot;chakra-modal--body-656&quot;]/button&quot;}
  </code></pre>
  <p>My Code is :</p>
  <pre><code>    //enter CC details
      driver.switchTo().frame(4);
      driver.findElement(By.cssSelector(&quot;input[name='cardnumber']&quot;)).sendKeys(CCNUM);
      driver.findElement(By.cssSelector(&quot;input[name='exp-date']&quot;)).sendKeys(expiry);
      driver.findElement(By.cssSelector(&quot;input[name='cvc']&quot;)).sendKeys(cvc);
      driver.findElement(By.cssSelector(&quot;input[name='postal']&quot;)).sendKeys(zip);
      System.out.println(&quot;cc details entered&quot;);
      driver.switchTo().defaultContent();
      System.out.println(&quot;default content&quot;);
      Thread.sleep(2000);
      
      // Click purchase button
      driver.findElement(By.xpath(&quot;//*[@id=\&quot;chakra-modal--body-684\&quot;]/button&quot;)).click();
  
      Thread.sleep(2000);
      driver.close();
  </code></pre>