无法通过Cypress与Stripe iframe元素交互的问题排查
Cypress测试Stripe iframe加载失败问题
我们使用Cypress进行Web UI自动化测试时,遇到以下问题:注册流程中的Stripe iframe在手动操作时加载正常,但通过Cypress执行时,其底层body未加载。该功能上周仍正常运行,目前突然失效。
执行情况对比
- 手动执行:iframe显示正常,对应DOM结构完整
- Cypress执行:iframe未正常加载,DOM结构缺失
使用的定位器代码
cy.iframe('iframe[title="Secure card number input frame"]').find('input[class="InputElement is-empty Input Input--empty"]')
报错信息
AssertionError: Timed out retrying after 10000ms: Expected to find element: `iframe[title="Secure card number input frame"]`, but never found it.
内容的提问来源于stack exchange,提问作者Gurupreeth Karnik
相关产品推荐
相关产品推荐

