Unable to locate element of credit card number using selenium python

The error message

Unable to locate the element

usually because element generated by javascript, use WebDriverWait

inputCC = WebDriverWait(driver, 15).until(
    lambda driver: driver.find_element_by_xpath("//input[@id='credit-card-number']")
)
inputCC.send_keys(creditcardnumber)

other possibility is the element located in iframe

Leave a Comment