chrome 远程接口 ECONNREFUSED 127.0.0.1:9222

问题描述

我正在使用 Testcafe,它不直接支持访问 Chrome 开发工具。我的目标是切断网络,以便我可以在网站中看到错误对话框。这是我写的代码。 TestCafe 在不同的 url 打开 这是网址:http://192.168.0.123:52678/someRandomStringHere/https://abcdefgh.com/abcdefgh/

我无法为此网址配置参数。仅供参考,端口号更改,不是固定的。 有人可以帮我解决这个问题吗。


//Performing some actions using Testcafe here


let config = {
        offline: true,latency: 100,downloadThroughput: 750 * 1024 / 8,uploadThroughput: 250 * 1024 / 8
    };


    const CDP = require('chrome-remote-interface');
    const client = await CDP();
    const {Network} = client;

    await Promise.all([
        Network.enable()
    ]);
    Network.emulateNetworkConditions(config);


//Checking if the error is present or not in website after cutting the network

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)