I'm trying to fill into this element using playwright python. The element is in an iframe and the number at the end of the tag is always different. My code looks like this:
frame = page.frame_locator('.js-iframe')
await asyncio.sleep(3)
code = frame.get_by_placeholder('3 digits')
await code.fill('559')
Here is the iframe:
<iframe src="src" class="js-iframe" title="Iframe for security code" allowtransparency="true" referrerpolicy="origin"><p>Your browser does not support iframes.</p></iframe>
This is the element:
<input id="adyen-checkout-encryptedSecurityCode-13535234466" data-fieldtype="encryptedSecurityCode" type="text" inputmode="numeric" maxlength="4" autocomplete="cc-csc" placeholder="3 digits" aria-label="Security code" aria-invalid="false" aria-required="true" aria-describedby="adyen-checkout-encryptedSecurityCode-13535234466-ariaContext" class="js-iframe-input input-field" data-type="gsf" style="display: block;">
Any help would be appreciated!
It doesn't fill in, I've noticed that the field only accepts integers, I've tried to fill it integers like this: number=456 code.fill(str(number))
When I try to see the trace, 2 errors come up: