ios - IOS 设备上的 Testcafe typeText 在第三方 iframe 上不起作用
问题描述
我在 IOS 设备和 testcafé 上使用 typeText 时遇到了一些问题。相同的脚本适用于桌面浏览器、android 浏览器,但不适用于 IOS。我曾尝试在 Browserstack Automate 上托管真实设备,并在我手中的设备上尝试过整洁的 testcafe 功能 --qr-code。相同的行为。
添加文本的代码中没有任何错误。当以下元素应该可见时,我收到错误消息。
我之前也尝试过使用 WebDriver(用 Java 编码),但是 sendKeys() 遇到了同样的问题
我很确定 IOS 和 Safari 需要一些特殊处理,但我不知道需要什么。
我的代码是这样的:
async payWithCreditCardSecure(cardNumber, expiryDate, cvc) {
await t
.click(this.creditCardRadioButton)
.switchToIframe(this.creditCardNumberIFrame)
.typeText(this.creditCardNumber, cardNumber, {paste: true, replace: true})
.switchToMainWindow()
.switchToIframe(this.creditCardExpiryDateIFrame)
.typeText(this.creditCardExpiryDate, expiryDate, {paste: true, replace: true})
.switchToMainWindow()
.switchToIframe(this.creditCardCVCIFrame)
.typeText(this.creditCardCVC, cvc, {paste: true, replace: true})
.switchToMainWindow()
.click(this.finishPurchaseCreditCard) **// BUTTON NEVER GETS ACTIVE SINCE NO TEXT IS ADDED**
.typeText(this.creditCardSecureUsername, creditCardCredentials.user) **//HERE IT FAILS**
.typeText(this.creditCardSecurePassword, creditCardCredentials.password)
.click(this.creditCardSecureSubmit)
}
该元素如下所示:在此处输入图像描述
UI 如下所示:在此处输入图像描述
提前致谢。
解决方案
我已经在 Safari 中重现了所描述的行为。我在 TestCafe 存储库中创建了一个问题。请点击以下线程以获取进度通知:
typeText 操作在 Safari 的第三方 iframe 中不起作用
(更新:问题已修复)
推荐阅读
- android - Android Firebase 服务(如 Messaging、Deeplink)不适用于构建版本
- javascript - Express TypeError:无法读取未定义的属性“获取”
- javascript - 通过 Flask 将 numpy 数组作为字节从 python 发送到 JS
- python - 从保管箱文件获取文件修订时遇到问题 - python SDK
- java - 我如何解析给定的 json 格式?
- java - 查找自动完成字符串
- linux - 从项目中的 yml 文件中获取 rpm 规范的版本
- python - 根据字典值获取不同的集合
- firebase - Firebase:配额组“CPUMilliSecondsNonbillable”超出配额
- python - Python - 如何替换文本文件中的出现?