0

I'm trying to interact with the field of Klarna Checkout on a website, but I'm not able to change the selected radio buttons nor enter information in the credit card fields. I'm using VS code, Python and selenium webdriver.

The website destination is: https://voltfashion.com/no/functional/kassen/ You need to add an item in order to see the "Klarna checkout section". It is a Norwegian website.

I have tried some different coding solutions, but none of them worked. I didn't have any problems interacting with the other elements of the website, just the Klarna checkout section. Any suggestions?

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

Some of the code I've tried:

cardForm = driver.find_element_by_id("cardNumber")
cardForm.send_keys('1234567890987654')

and

inputCC = WebDriverWait(driver, 5).until\
    (lambda driver: driver.find_element_by_xpath\
        ("//input[@id='cardNumber']")
)
inputCC.send_keys("1234567890987654")

Klarna screenshot (Source):

enter image description here

KishuInu
  • 61
  • 7
  • you have to add url to real html so we could see it in browser – furas Dec 15 '21 at 00:15
  • maybe element is in `iframe` and it needs `switch_to_frame`, or maybe elements are hidden and it display some replacements. But we can't check it without url to real HTML. – furas Dec 15 '21 at 00:17
  • @furas The website is in Norwegian, so that's why I was a little hesitant to add it (in case nobody was able to navigate it due to the languanga barrier). Here is the website: [link](https://voltfashion.com/no/functional/kassen/). You have to add an item before you are able to visit the "Klarna checkout section" – KishuInu Dec 15 '21 at 00:37
  • add this to question so other people could see it - and then other people can help you. – furas Dec 15 '21 at 00:47
  • It seems this part is in ` – furas Dec 15 '21 at 01:26
  • @furas I've tried the "driver.switch_to.frame()", but maybe I did it wrong. Could you please give me a short specific code snippet which insert a number into the credit card field? So that I could test and know that I didn't do anything wrong. – KishuInu Dec 15 '21 at 11:10
  • I would have to create minimal working code for this - and this means code which put item in cart, fill form, etc. It is long code. – furas Dec 17 '21 at 00:38
  • @furas No worries! Thank you for taking the time to answer :) – KishuInu Dec 17 '21 at 15:07

0 Answers0