Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/12.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
在PhantomJS和量角器中设置用户代理_Phantomjs_Protractor - Fatal编程技术网

在PhantomJS和量角器中设置用户代理

在PhantomJS和量角器中设置用户代理,phantomjs,protractor,Phantomjs,Protractor,我在用量角器和幻影。如何设置PhantomJS发送的用户代理?不同的测试是否会有所不同?在功能下设置phantomjs.page.settings.userAgent: capabilities: { "browserName": "phantomjs", "phantomjs.page.settings.userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/53 (KHTML, like Gecko) Chrome/1

我在用量角器和幻影。如何设置PhantomJS发送的用户代理?不同的测试是否会有所不同?

功能下设置
phantomjs.page.settings.userAgent

capabilities: {
    "browserName": "phantomjs",
    "phantomjs.page.settings.userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/53 (KHTML, like Gecko) Chrome/15.0.87"
}