'Waits for pdf frame to load, then switches driver to the frame'

def switch_to_pdf_frame(self, test):

    EmptyPromise((lambda : self.q(css='iframe').present), 'Iframe    loaded').fulfill()
    driver = test.get_web_driver()
    driver.switch_to_frame(driver.find_element_by_tag_name('iframe'))
