Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/16.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
在firefox上使用量角器和seleniumAddress设置用户代理不起作用_Firefox_Selenium Webdriver_Protractor_User Agent - Fatal编程技术网

在firefox上使用量角器和seleniumAddress设置用户代理不起作用

在firefox上使用量角器和seleniumAddress设置用户代理不起作用,firefox,selenium-webdriver,protractor,user-agent,Firefox,Selenium Webdriver,Protractor,User Agent,我想使用Gragrator和Firefox设置一个特定的用户代理。如果我在dragrator.conf.js上使用directConnect,它可以工作: //selenium webdriver是通过npm安装的 var firefox=require('selenium-webdriver/firefox'); var firefoxProfile=new firefox.Profile(); firefoxProfile.setPreference(“general.useragent.o

我想使用Gragrator和Firefox设置一个特定的用户代理。如果我在dragrator.conf.js上使用directConnect,它可以工作:

//selenium webdriver是通过npm安装的
var firefox=require('selenium-webdriver/firefox');
var firefoxProfile=new firefox.Profile();
firefoxProfile.setPreference(“general.useragent.override”,“monitoring1152936086”);
exports.config={
directConnect:没错,
能力:{
'browserName':'firefox',
“firefox_配置文件”:firefox配置文件
},
...
}
但是,如果我使用seleniumAddress而不是directConnect,它将不起作用。测试确实有效,但未使用用户代理。我需要使用selenium服务器。例如:

var firefox=require('selenium-webdriver/firefox');
var firefoxProfile=new firefox.Profile();
firefoxProfile.setPreference(“general.useragent.override”,“monitoring1152936086”);
exports.config={
赛琳娜的裙子:'http://localhost:4444/wd/hub',
能力:{
'browserName':'firefox',
“firefox_配置文件”:firefox配置文件
},
...
}
顺便说一句,我不能使用chrome,因为我正试图使用Firefox作为一种解决办法,来解决Progrator和selenium docker与chrome()不太稳定的组合


有什么想法吗?谢谢

在直连式量角器中,量角器创建浏览器本身,因此它能够在浏览器上进行总体配置。在远程情况下,量角器控制较少,因为它连接到由
webdriver manager
启动的selenium服务器。传递firefox配置文件的正确时间应该是
webdriver manager
启动时,但Gradurator当前不提供此功能。

有关此问题的报告,请参阅。