With chromedriver.exe with version 2.28 on wards, when tried to invoke chrome browser using selenium, getting below notification as “Chrome is being controlled by automated test software”
This is just a warning or notification from chrome browser, no harm if pops up,
This just tells to make you aware that some body is controlling your application [here, the selenium scripts]
How to get rid of this
We can use ChromeOptions to avoid this notification on browser.
options.addArguments("disable-infobars");
public class TestChrome { public static void main(String[] args) { WebDriver driver; System.setProperty("webdriver.chrome.driver","c:\\Grid\\chromedriver.exe"); ChromeOptions options = new ChromeOptions(); options.addArguments("disable-infobars"); driver=new ChromeDriver(options); driver.get("http://qavalidation.com"); } }
Above code block might not work on latest browser versions (>76 as per the chrome statement), we have to implement differently –
options.setExperimentalOption("excludeSwitches", Collections.singletonList("enable-automation"));
So the code is something like
public class TestChrome { public static void main(String[] args) { WebDriver driver; System.setProperty("webdriver.chrome.driver","c:\\Grid\\chromedriver.exe"); ChromeOptions options = new ChromeOptions(); options.setExperimentalOption("excludeSwitches", Collections.singletonList("enable-automation")); driver=new ChromeDriver(options); driver.manage().window().maximize(); driver.get("http://qavalidation.com"); } }