ARTICLE AD BOX
I am working on a project where I am using WPF and C# with Selenium. It automates some steps in one web page. I am using a specific user-profile to do it. It's a company owned laptop. When Selenium launches the browser, I see a footer in the chrome saying Managed by your Organization. The problem is sometimes it is working fine but smetimes my desired page opens inside this footer area. I am facing the issue in Normal mode as well as headless mode. Below is my code
ChromeOptions chromeOptions = new ChromeOptions(); chromeOptions.AddArgument(@"--user-data-dir=" + ChromeProfileUtilities.ProfilePath); chromeOptions.AddArgument("--profile-directory=Default"); if ((bool)RunParams.IsHeadless) { chromeOptions.AddArgument("--headless=new"); } var service = ChromeDriverService.CreateDefaultService(); service.HideCommandPromptWindow = true; driver = new ChromeDriver(service, chromeOptions); driver.Navigate().GoToUrl("https://google.com"); if (!(bool)RunParams.IsHeadless) { driver.Manage().Window.Maximize(); } else if ((bool)RunParams.IsHeadless) { driver.Manage().Window.FullScreen(); }I have tried lot of different approaches, but nothing works. I am also sharing a screenshot about my problem. There you can see Google opened in the footer area. Scheenshot
Is there any way to make sure selenium always opens the page normally in the main browser area? Thanks in advance..
