I am working on a project with Python and Selenium. In the image you can see the code of the input field in which I try to insert my text.
<input data-v-382b0a6e="" id="expiration" name="expiration" type="text" required="required" data-test="expiration-input" autocomplete="billing cc-exp" dir="auto" class="form-textbox form-textbox-text form-textbox-entered" style="" aria-invalid="true">
My first approach was to use the .send_keys(variable)
function. The issue there is that the variable month will be inserted in the year. I tried to clear the input field and click into it before, but it didn't help.
WebDriverWait(driver, 30).until(
EC.presence_of_element_located(
(By.XPATH, "//*[@data-test='expiration-input']"))).send_keys(expMonth)
The following image shows the error.
I also tried to use a Javascript executor to insert a value into this input field, but it has no value attribute and it won't use this attribute.
I have clue what I can do here anymore. Has someone a hint for me how I can insert my text into this field?