splinter icon indicating copy to clipboard operation
splinter copied to clipboard

Set user-agent for remote webdriver?

Open victorhooi opened this issue 12 years ago • 3 comments

Is there any way to set the user-agent for a remote webdriver?

I'm managed to set it for local Firefox and Chrome instances - however, when I use the remote webdriver, it seems to ignore it?

victorhooi avatar Jan 24 '14 04:01 victorhooi

@victorhooi you can set the browser parameter. There is an example here: http://splinter.cobrateam.info/docs/drivers/remote.html#useing-the-remote-webdriver

andrewsmedina avatar Jan 24 '14 12:01 andrewsmedina

@andrewsmedina Yes, we're using that to get the actual different browser engines (e.g. Firefox verus Chrome versus IE).

However, we'd like to actually set the user agent - e.g. to something like:

Mozilla/5.0 (iPhone; U; ru; CPU iPhone OS 4_2_1 like Mac OS X; ru) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148a Safari/6533.18.5

(In our case, it's to test some mobile user agent redirections).

Is this possible?

victorhooi avatar Jan 24 '14 17:01 victorhooi

Closing this issue due to age.

For future reference, the user agent for a remote webdriver instance can be set by passing in an Options object with the user-agent argument set.

javascript-error avatar Apr 06 '22 15:04 javascript-error