How to change selenium user agent in selenium-webdriver nodejs land?

216 views
Skip to first unread message

Andrew Ray

unread,
Aug 29, 2013, 3:09:42 PM8/29/13
to seleniu...@googlegroups.com

I'm in javascript + mocha + node land.

I have tried setting userAgent and 'user-agent' as keys on capabilities:

var webdriver = require('selenium-webdriver');
var ua = 'Mozilla/5.0 (iPhone; CPU iPhone OS 5_0 like Mac OS X)';

var driver = new webdriver.Builder().
     ...
     withCapabilities({ 'browserName': 'firefox',
        userAgent: ua,
        'user-agent': ua,
    }).
    build();

There is this answer which says to use a firefox profile, but that's not exposed. There is nodriver.FirefoxProfile nor one exposed globally nor webdriver.FirefoxProfile nordriver.profiles etc.

I have tried Googling and looking the source and the documentation but there is nothing on this.

Reply all
Reply to author
Forward
0 new messages