How to switch back from iFrame index to the relative parent in (Python)? I use this code but not working for me :
def type_order_credit_card1_number(self, credit_card_1_number):
WebDriverWait(self.driver, 80).until(EC.frame_to_be_available_and_switch_to_it((By.XPATH, '//iframe[1]')))
WebDriverWait(self.driver, 80).until(EC.element_to_be_clickable((By.XPATH, self.order_credit_card_number_text_id))).send_keys(credit_card_1_number)
time.sleep(4)
def type_order_credit_card_expiry_date(self, credit_card_1_expiry_date):
WebDriverWait(self.driver, 80).until(EC.frame_to_be_available_and_switch_to_it((By.XPATH, '//iframe[2]')))
WebDriverWait(self.driver, 80).until(
EC.element_to_be_clickable((By.XPATH, self.order_credit_card_expiry_date_text_id))).send_keys(
credit_card_1_expiry_date)
I want to switch from [selectFrame index=2] to [selectFrame relative=parent] to type credit card expiry date and cvv (the card number works fine)