Наконец, я нашел решение, это код:
def type_order_credit_card1_information(self):
# Enter the credit card number
IwebElement_Element = self.driver.find_element_by_xpath('//iframe[1]')
self.driver.switch_to.frame(IwebElement_Element)
test = WebDriverWait(self.driver, 20).until(
EC.element_to_be_clickable((By.XPATH, "//input[@id='encryptedCardNumber']")))
test.send_keys(credit_card1_number)
self.driver.switch_to.parent_frame() # To switch to the parent frame
# Enter the credit card expiry date
IwebElement_Element2 = self.driver.find_element_by_xpath('//*[@id="adyen-card-container"]/div/div/div[2]/div/div[2]/div[1]/label/span[2]/span/iframe')
self.driver.switch_to.frame(IwebElement_Element2)
test = WebDriverWait(self.driver, 20).until(
EC.element_to_be_clickable((By.XPATH, "//input[@id='encryptedExpiryDate']")))
test.send_keys(credit_card1_expiry_date)
self.driver.switch_to.parent_frame() # To switch to the parent frame
# Enter the credit card cvv security number
IwebElement_Element3 = self.driver.find_element_by_xpath(
'//*[@id="adyen-card-container"]/div/div/div[2]/div/div[2]/div[2]/label/span[2]/span/iframe')
self.driver.switch_to.frame(IwebElement_Element3)
test = WebDriverWait(self.driver, 20).until(
EC.element_to_be_clickable((By.XPATH, "//input[@id='encryptedSecurityCode']")))
test.send_keys(credit_card1_cvv_number)
self.driver.switch_to.parent_frame() # To switch to the parent frame