I have the following page
<body>
  <iframe id="outer_frame">
    <iframe id="search_button_frame">
      <button id="search_button"></button>
    </iframe>
  </iframe>
</body>
Now after I click on the search_button the two frames outer_frame and search_button_frame are no longer in DOM and instead the page becomes like this
<body>
  <iframe id="form_frame">
    ...
  </iframe>
</body>
I'm trying to go to the search_button then get out of the frames into the main page, and then switching to the form_frame using this:
outer_frame = browser.find_element_by_xpath('//*[@id="outer_frame"]')
browser.switch_to.frame(outer_frame)
search_button_frame = browser.find_element_by_xpath('//*[@id="search_button_frame"]')
browser.switch_to.frame(search_button_frame)
search_button = browser.find_element_by_xpath('//*[@id="search_button"]')
search_button.click()
browser.switch_to_default_content()
form_frame = browser.find_element_by_xpath('//*[@id="form_frame"]')
browser.switch_to.frame(form_frame)
but I keep getting the following error:
selenium.common.exceptions.NoSuchElementException: Message: no such element: Una
ble to locate element: {"method":"xpath","selector":"//*[@id="form_frame"]"}
does this mean I'm not positioned in the right frame?
 
     
    