首页 > 解决方案 > 脚本仅在 ie 浏览器中挂起

问题描述

我想在 IE11 中执行此代码,但它进入挂起模式而不单击是按钮无法理解原因同时它在 chrome 和 FF 中工作正常

尝试使用选项 -e --skip-js 错误

import { Selector } from 'testcafe';

fixture(' testcafe ie issue')
.page('https://www1.shoppersdrugmart.ca/en/home');
test('testcafe ie issue', async (t) => {

const medicalCannabisImage=Selector('.wg-hdr-nav-img').nth(0);
const ageGatePopUp = Selector('.age-gate');
const pageContainser=Selector('div#app')

const yesAgePopUp = Selector('[data-auid="age-gate-primary"]');

await t.click(medicalCannabisImage);
if (await ageGatePopUp.exists) {
await t.click(yesAgePopUp);
}

});

我想在 IE11 中执行此代码,但它进入挂起模式而不单击是按钮无法理解原因,同时它在 chrome 和 FF 中工作正常。

标签: automated-testse2e-testingtestcafebrowser-automationweb-testing

解决方案


我们已经重现了这个问题,发现它的原因与这个 GitHub 问题有关:

在 IE11 中找不到元素 

根据团队的评论,修复正在进行中。

更新

该修复程序已准备就绪,可在 testcafe@v1.0.0-alpha.2 版本中使用。


推荐阅读