question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`disable-infobars` gets lost in Selenide

See original GitHub issue

The problem

Selenide opens browser with an annoying “this browser is being controlled by automated software” infobar at the top, thought I add disable-infobars option. This option still works when I use pure Selenium (see code below).

Code To Reproduce Issue

public class ChromeOptionsTest {
  WebDriver driver;

  @Test
  void viaOptions() {
    ChromeOptions options = new ChromeOptions();
    options.addArguments("disable-infobars");
    driver = new ChromeDriver(options);
    driver.navigate().to("https://google.com");      // NB! No infobar
    sleep(3000);
  }

  @Test
  void viaCapabilities() {
    ChromeOptions options = new ChromeOptions();
    options.addArguments("disable-infobars");
    DesiredCapabilities caps = DesiredCapabilities.chrome();
    caps.setCapability(ChromeOptions.CAPABILITY, options);
    driver = new ChromeDriver(caps);
    driver.navigate().to("https://google.com");      // NB! No infobar
    sleep(3000);
  }

  @Test
  void viaSelenide() {
    ChromeOptions options = new ChromeOptions();
    options.addArguments("disable-infobars");
    DesiredCapabilities caps = DesiredCapabilities.chrome();
    caps.setCapability(ChromeOptions.CAPABILITY, options);

    Configuration.browser = "chrome";
    Configuration.browserCapabilities = caps;

    open("https://google.com");      // NB! Infobar is visible! Like `disable-infobars` didn't work.
    sleep(3000);
  }

  @AfterEach
  void tearDown() {
    if (driver != null) driver.quit();
  }
}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ksivcommented, Jan 13, 2021

@asolntsev Thanks, friend! your code in the topic start is the best show-case I’v found so far on the issue. Only you need to correct the name to “Capabilities are lost in Selenide”. Change “disable-infobars” to “start-maximized” and you ll see this one is lost as well. One may link it to #676 but this one is better because it shows the difference 😃 it is also clean no try to “merge” options and other complication UPD: Sorry fried for commenting to closed issue , seems fixed somewhere before Selenide v. 5.17.3. Been working on an old project with 5.5.1 so come across it anew

1reaction
BorisOsipovcommented, Jan 30, 2019
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to remove the infobar "Microsoft Edge is being controlled ...
I tried to set the same options and I got a browser launched without the infobar, but it is a chrome browser NOT...
Read more >
Selenium - Disabling InfoBar warning "Chrome is ... - YouTube
Selenium - Disabling InfoBar warning "Chrome is being controlled by automated test software".
Read more >
Disable browser location on Execution - Katalon Community
I am just wondering if there is a flag or something that I can set so that when the browser is launched, the...
Read more >
webdriverio/webdriverio - Gitter
I dont wanna disable all of them, just "chrome is being controlled by ... how we can override the selenium configs :P i...
Read more >
window.chrome.runtime not available in chrome driver.
we were seeing that the app gets stuck at a certain page and doesn't load further. ... You can disable such info bars...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found