Node.js Selenium网格-Chrome性能日志在网格节点中不可用
我正在使用Selenium网格。每当我从节点(LAN中的WebDriver)请求性能日志时,就会发生错误<代码>WebDriverError:参数无效:未找到日志类型“性能” 这对本地的网络驱动程序很好。唯一的区别是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'}) 最终代
。使用服务器('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();
}