Can a server differentiate between the Chrome Webdriver and actual Chrome?

google-chrome selenium-webdriver

62 просмотра

1 ответ

12295 Репутация автора

As far as I can tell, there's no way for a server to tell whether it's being accessed through the Chrome Webdriver or by an actual user in front of Chrome. Is this correct?

Автор: tbodt Источник Размещён: 22.08.2016 09:20

Ответы (1)

0 плюса

1304 Репутация автора


Without specific checks on the server side I doubt that it can be detected. However, it can be put in place. One way that I'm thinking of is checking the browser preferences.

Let's take for instance the new Selenium driver used for Firefox versions 48+, the Marionette-based geckodriver. Mozilla took ownership of the driver server and citing from the Github project page:

Proxy for using W3C WebDriver-compatible clients to interact with Gecko-based browsers.

This program provides the HTTP API described by the WebDriver protocol to communicate with Gecko browsers, such as Firefox. It translates calls into the Marionette automation protocol by acting as a proxy between the local- and remote ends.

To achieve this, Mozilla implemented some WebDriver extensions built in into the browser itself.

If you go to about:config in Firefox and search for webdriver you will see some preferences that, when the browser is started by the Selenium driver they appear as user set. So this is one way of checking it.

Another one, somehow related to the first one is the Firefox profile that Selenium WebDriver creates when starts the browser that has a kind of distinguishable name. One note although, this is only using the default Selenium settings. If you, as a user create a Firefox profile that afterwards get imported in the Selenium WebDriver before initialization, there won't be any more difference, except the first point mentioned. The user preference settings.

And in same manner, this applies to all the Selenium browser drivers, so it would be applicable to Chrome to some extent too. However, I'm sorry that I can't be more specific like in Firefox's case.

Автор: Cosmin Размещён: 23.08.2016 07:02
Вопросы из категории :