LoginSignup
6
7

More than 3 years have passed since last update.

Chromeの「自動テストソフトソフトウェアによって制御されています」を消す

Last updated at Posted at 2019-12-13

自動テストを実行する際に表示される「自動テストソフトソフトウェアによって制御されています」を消す方法をあちこちのページを跨いで解決したのでまとめました。
webdriver_managerを使った場合の消し方になります。

環境

Windows10 Pro 64bit
Python3.7
Selenium
webdriver_manager

やること

・オプションを定義する
・そのオプションを使ってWebdriverを立ち上げる
 ...簡単。

sample.py
chrome_options = webdriver.ChromeOptions()
chrome_options.add_experimental_option("excludeSwitches", ['enable-automation'])
driver = webdriver.Chrome(ChromeDriverManager().install(), options=chrome_options)

['enable-automation']を['disable-automation']にすると、また「自動テストソフトソフトウェアによって制御されています」が表示されます。

追記
「デベロッパーモードの拡張機能を無効〜」とアラートがでるようになったのでそれも消したい。
オプションに「'load-extension']」を追加すると消えるようなので追加。
最終的にはこうなりました。

sample2.py
chrome_options = webdriver.ChromeOptions()
chrome_options.add_experimental_option("excludeSwitches", ['enable-automation', 'load-extension'])
driver = webdriver.Chrome(ChromeDriverManager().install(), options=chrome_options)

参考ページ

http://serverless.hateblo.jp/entry/2018/10/26/101428
https://help.applitools.com/hc/en-us/articles/360007189411--Chrome-is-being-controlled-by-automated-test-software-notification
https://github.com/SergeyPirogov/webdriver_manager

6
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
7