首页 > 解决方案 > Testcafe 初始设置

问题描述

我得到错误Safari can't open the page "https://localhost:52169/browser/connect/r5cJvcm" because Safari can't establish a secure connection to the server "localhost"

当我尝试执行这个

testcafe safari TestFile2.js --hostname localhost

上面的命令确实适用于 chrome 但是如果我尝试执行而不指定--hostname localhost它会抛出错误ERR_CONNECTION_TIMED_OUT

如何正确完成初始设置以执行 testcafe 测试

是的,我需要在连接到 VPN 时执行测试

我确实尝试在 System Preferences -> Security & Privacy -> Privacy -> Automation and screenrecording 中启用 TestCafe 浏览器工具。但这并没有帮助。

标签: testingautomationautomated-testse2e-testingtestcafe

解决方案


--hostnameVPN 连接的情况下需要指定选项。它应该适用于所有浏览器。有关详细信息,请参阅以下线程:https ://stackoverflow.com/a/56219385/10448174 。


推荐阅读