Carlos Granados
Carlos Granados

Reputation: 11351

Set user agent in PhantomJS and Protractor

I am using Protractor with PhantomJS. How can I set the user agent that PhantomJS sends? Can it be different for different tests?

Upvotes: 2

Views: 565

Answers (1)

alecxe
alecxe

Reputation: 474191

Set the phantomjs.page.settings.userAgent under capabilities:

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

Upvotes: 2

Related Questions