I am testing a endpoint made with aspx with cypress the issue appears on a popup iframe form for adding credit card info when I complete the info and hit on save buttom using of course cypress test runner this function or buttom doesnt work so I assume it looks like it’s not loading the credit card library, it looks like cypress is not allowing it to load for some reason.
this cypress code represents how i go through iframe and try to submit the info for credit card form
cy.frameLoaded('#P_L_V_v224w2_t21_c0w0_NB_ITC1i0_t1_0_c0w0_0_t0_0_CreditCardControl_0_CreditCardTokenControl_0_CreditCardTokenPopup_0_CCTokenFrame_0'); // Ensure the iframe is loaded
cy.iframe('#P_L_V_v224w2_t21_c0w0_NB_ITC1i0_t1_0_c0w0_0_t0_0_CreditCardControl_0_CreditCardTokenControl_0_CreditCardTokenPopup_0_CCTokenFrame_0').within(() => {
// Interact with the form elements inside the iframe
cy.get('#FieldsForm').within(() => {
cy.get('input[name="TokenFieldsControl$CardNumberTextBox"]').type('4111111111111111');
cy.get('input[name="TokenFieldsControl$ExpirationDate$ExpirationDate"]').clear().type('012025');
cy.get('input[name="TokenFieldsControl$SecurityCodeTextBox"]').type('123');
cy.get('div[id="TokenFieldsControl_SaveButton_CD"] span').click();
});
});
this is the endpoint credit card form html
<div class="dxpc-mainDiv dxpc-shadow">
<div class="dxpc-header drag dxpc-withBtn" style="-webkit-user-select:none;" id="P_L_V_v224w2_t21_c0w0_NB_ITC1i0_t1_0_c0w0_0_t0_0_CreditCardControl_0_CreditCardTokenControl_0_CreditCardTokenPopup_0_PWH-1">
<div class="dxpc-closeBtn" id="P_L_V_v224w2_t21_c0w0_NB_ITC1i0_t1_0_c0w0_0_t0_0_CreditCardControl_0_CreditCardTokenControl_0_CreditCardTokenPopup_0_HCB-1">
<img src="images/button_popup_close.gif" alt="Close">
</div><div class="dxpc-headerContent" style="margin-left: 0px; margin-right: 24px; line-height: 10px; height: 14px;">
<span class="dxpc-headerText dx-vam" id="P_L_V_v224w2_t21_c0w0_NB_ITC1i0_t1_0_c0w0_0_t0_0_CreditCardControl_0_CreditCardTokenControl_0_CreditCardTokenPopup_0_PWH-1T">Enter New Card</span>
</div><b class="dx-clear"></b>
</div><div class="dxpc-contentWrapper" style="display: table;">
<div class="dxpc-content" id="P_L_V_v224w2_t21_c0w0_NB_ITC1i0_t1_0_c0w0_0_t0_0_CreditCardControl_0_CreditCardTokenControl_0_CreditCardTokenPopup_0_PWC-1" style="display: table-cell;">
<iframe src="CreditCardToken.aspx" id="P_L_V_v224w2_t21_c0w0_NB_ITC1i0_t1_0_c0w0_0_t0_0_CreditCardControl_0_CreditCardTokenControl_0_CreditCardTokenPopup_0_CCTokenFrame_0" style="border-width:0px;;"></iframe>
</div>
</div>
</div>
finally I attach part of the iframe html code of the endpoint credit card form
enter image description here