Selenium with Python: Frames
element = driver.switch_to.active_element
alert = driver.switch_to.alert driver.switch_to.default_content() driver.switch_to.frame('frame_name') driver.switch_to.frame(1) driver.switch_to.frame(driver.find_elements(By.TAG_NAME, "iframe")[0]) driver.switch_to.parent_frame() driver.switch_to.window('main')
Example:
#driver.get("https://testlayers.staging.senegalsoftware.com/JobPosts/create?id=326D4402-25C1-4D7E-81DB-23DA5AF14111&step=2")driver.switch_to.frame(driver.find_element(By.XPATH, '//*[@id="cke_1_contents"]/iframe'))driver.find_element(By.TAG_NAME, "p").send_keys("Dentist")driver.switch_to.parent_frame()