Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js Selenium网格-Chrome性能日志在网格节点中不可用_Node.js_Selenium_Selenium Grid - Fatal编程技术网

Node.js Selenium网格-Chrome性能日志在网格节点中不可用

Node.js Selenium网格-Chrome性能日志在网格节点中不可用,node.js,selenium,selenium-grid,Node.js,Selenium,Selenium Grid,我正在使用Selenium网格。每当我从节点(LAN中的WebDriver)请求性能日志时,就会发生错误WebDriverError:参数无效:未找到日志类型“性能” 这对本地的网络驱动程序很好。唯一的区别是。使用服务器('http://192.168.1.113:5566/wd/hub) 添加以下代码修复了该问题 var caps = Capabilities.chrome(); caps.set('goog:loggingPrefs', {'performance':'ALL'}) 最终代

我正在使用Selenium网格。每当我从节点(LAN中的WebDriver)请求性能日志时,就会发生错误<代码>WebDriverError:参数无效:未找到日志类型“性能”

这对本地的网络驱动程序很好。唯一的区别是
。使用服务器('http://192.168.1.113:5566/wd/hub)


添加以下代码修复了该问题

var caps = Capabilities.chrome();
caps.set('goog:loggingPrefs', {'performance':'ALL'})
最终代码

const { Builder, Capabilities } = require('selenium-webdriver');

var caps = Capabilities.chrome();
caps.set('goog:loggingPrefs', {'performance':'ALL'})

var isLAN = true;
if (isLAN) {
    const driver = new Builder()
        .usingServer('http://192.168.1.104:5566/wd/hub')
        .withCapabilities(caps)
        .build();

    driver.get('http://stackoverflow.com/');
    driver.manage().logs().get('performance').then(function (entries) {
        console.log(entries);
    });
    driver.quit();
} else {
    const driver = new Builder()
        .forBrowser('chrome')
        .withCapabilities(caps)
        .build();

    driver.get('http://stackoverflow.com/');
    driver.manage().logs().get('performance').then(function (entries) {
        console.log(entries);
    });
    driver.quit();
}
const { Builder, Capabilities } = require('selenium-webdriver');

var caps = Capabilities.chrome();
caps.set('goog:loggingPrefs', {'performance':'ALL'})

var isLAN = true;
if (isLAN) {
    const driver = new Builder()
        .usingServer('http://192.168.1.104:5566/wd/hub')
        .withCapabilities(caps)
        .build();

    driver.get('http://stackoverflow.com/');
    driver.manage().logs().get('performance').then(function (entries) {
        console.log(entries);
    });
    driver.quit();
} else {
    const driver = new Builder()
        .forBrowser('chrome')
        .withCapabilities(caps)
        .build();

    driver.get('http://stackoverflow.com/');
    driver.manage().logs().get('performance').then(function (entries) {
        console.log(entries);
    });
    driver.quit();
}