我正在尝试使用以下配置创建节点:
UPDATE Table SET SpatialColumn = ST_GeomFromText(ST_AsText(SpatialColumn), 4326);
如您所见,我在json文件中传递配置。除chromeOptions外,它正确设置配置。我需要打开无头镀铬。这是我的.json文件的一部分,它设置了功能。
java -Dwebdriver.chrome.driver=/randomfolder/chromedriver -jar selenium-server-standalone-3.4.0.jar -role node -nodeConfig node-conf.json
我尝试过编写chromeOptions的不同方法,但节点一直在忽略它们。我只是盲目而且没有看到我的错误? 提前谢谢!
答案 0 :(得分:0)
我也面临这个问题,但就我而言,我想修改用户代理,在Linux上,chromeOptions似乎被忽略了。这在Mac / Chrome上在本地为我工作。
//wdio.conf.js
capabilities: [{
browserName: "chrome",
chromeOptions : {
args : ['--user-agent=THIS_IS_A_TEST']
}
}],
//Jenkins job on Linux RHEA
13:42:33 [11/10/2018 13:42:33.049] [LOG] browser.desiredCapabilities = {
13:42:33 "javascriptEnabled": true,
13:42:33 "locationContextEnabled": true,
13:42:33 "handlesAlerts": true,
13:42:33 "rotatable": true,
13:42:33 "browserName": "chrome",
13:42:33 "acceptInsecureCerts": true,
13:42:33 "chromeOptions": {
13:42:33 "args": [
13:42:33 "--user-agent=THIS_IS_A_TEST",
13:42:33 "window-size=1600,1200"
13:42:33 ]
13:42:33 },
13:42:33 "loggingPrefs": {
13:42:33 "browser": "ALL",
13:42:33 "driver": "ALL"
13:42:33 }
13:42:33 }
13:42:33 [11/10/2018 13:42:33.072] [LOG] printNavigatorUserAgent() navigator.userAgent = Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.92 Safari/537.36
预期:printNavigatorUserAgent()navigator.userAgent = THIS_IS_A_TEST
printNavigatorUserAgent(){
let result = browser.execute(function() {
return navigator.userAgent;
},);
console.log(`printNavigatorUserAgent() navigator.userAgent = ${result.value}`);
}
更新:以下语法目前在Linux / chrome上对我有效。
//wdio.conf.js
capabilities: [{
browserName: "chrome",
"goog:chromeOptions" : {
"args" : ['user-agent=THIS_IS_A_TEST']
}
}],