title: Selenium- Click a button issue
body: <p><a href="https://i.stack.imgur.com/pQWIZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pQWIZ.png" alt="enter image description here" /></a></p>
  <p>using imports:</p>
  <pre><code>from selenium import webdriver
  from selenium.webdriver.common.by import By
  from selenium.webdriver.support import expected_conditions as EC
  from selenium.webdriver.support.ui import Select
  from selenium.webdriver.support.ui import WebDriverWait
  </code></pre>
  <p>using this def to navigate to the exact iFrame that the button is under :</p>
  <pre><code>def changeIframetoManagement():
      wait2 = WebDriverWait(driver, 10)
      wait2.until(EC.frame_to_be_available_and_switch_to_it((By.ID, &quot;moduleManagement&quot;)))
  </code></pre>
  <p>my attempt to achieve that task :</p>
  <pre><code>changeIframetoManagement()
  driver.find_element_by_css_selector(&quot;body &gt; div.bootbox.modal.fade.show-order-info-bootbox- 
  container.in &gt; div &gt; div &gt; div.modal-body &gt; button&quot;).click()
  </code></pre>
  <p>im also tried to reach by xPath like this</p>
  <pre><code>driver.find_element_by_xpath(&quot;//html/body/div[5]/div/div/div[1]/button&quot;).click()
  </code></pre>
  <p>that is the last i frame i was in</p>
  <pre><code>def changeIframetoOrders():
     wait3 = WebDriverWait(driver, 10)
     wait3.until(EC.frame_to_be_available_and_switch_to_it((By.NAME, 
     &quot;orderInfo&quot;)))
  </code></pre>
  <p><a href="https://i.stack.imgur.com/VVBn9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VVBn9.png" alt="this is the last i frame i was in" /></a></p>