You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

在需证书验证页面运行TestCafe自动化测试失败求解决方案

问题:TestCafe访问需证书验证页面时加载崩溃

我需要用TestCafe对一个需要证书验证的页面执行自动化测试,已在.testcaferc.json文件中配置SSL证书,但运行测试时出现以下异常:

  • Chrome窗口弹出「连接不安全」的确认提示,手动确认后被重定向至localhost
  • 随后TestCafe的Chrome窗口URL变为https://localhost:4200/about:error
  • 测试运行一段时间后自动重启,全程未抛出任何报错
  • 测试启动后页面加载随即崩溃

测试代码示例

fixture (`Info Page test`).page('www.google.com');

const infoPage = new InfoPage();
test('Check label on Info Page', async () => {
    await t.navigateTo('IP url')
    await t.wait(10000);
});

已尝试的无效解决办法

  • 先打开www.google.com页面再跳转至目标页面,无效果
  • 启动测试时添加--ignore-certificate-errors参数,无效
  • 改用主机名而非IP地址访问目标页面,同样无效

内容的提问来源于stack exchange,提问作者Kostiantyn Pavlenko

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.12 05:23:15