Chrome is being controlled by automated test software

后端 未结 13 1109
天涯浪人
天涯浪人 2020-12-01 10:49

I am running automated tests in Chrome with Serenity BDD (Selenium).

I had to download a new ChromeDriver, because my tests could not run -> The test would open Chro

13条回答
  •  广开言路
    2020-12-01 11:31

    Previously, passing the "disable-infobars” ChromeOption to the WebDriver prevented Chrome from displaying this notification. Recently, the "disable-infobars" option has been deprecated and no longer removes the notification. The current workaround for this is to pass in an option called "excludeSwitches" and then exclude the "enable_automation" switch.

    ChromeOptions options = new ChromeOptions(); 
    options.setExperimentalOption("excludeSwitches", new String[]{"enable-automation"}); 
    WebDriver driver = new ChromeDriver(options); 
    

提交回复
热议问题