0

This My Code

            ChromeDriverService service = ChromeDriverService.CreateDefaultService();
            service.HideCommandPromptWindow = true;

            ChromeOptions cOptions = new ChromeOptions();
            String pathToExtension = @"C:\Users\Evrenus\AppData\Local\Google\Chrome\User Data\Default\Extensions\cfhdojbkjhnklbpkdaibdccddilifddb\3.4.1_0";
            cOptions.AddArgument("load-extension=" + pathToExtension);
            cOptions.AddArgument("--window-size=2000,1190");
            cdriver = new ChromeDriver(service, cOptions);

            cdriver.Navigate().GoToUrl(link);

            int sayi = 0;
            foreach (var item in cdriver.WindowHandles)
            {
                if (sayi == 1)
                {
                    cdriver.SwitchTo().Window(item).Close();
                }
                ++sayi;
            }

When i was trigger this code i see chrome my screen. This application is twitch chat bot and while i streaming (usually game), viewers can open songs from my computer but my computer ALT + TAB

i try this code on my Form Load Event Selenium Chrome window running in second monitor screen stealing focus

  • Your question is about Selenium, but it sounds like that part is working... but I have no idea what you mean about other people opening songs on your computer, or what you mean by "but my computer ALT + TAB". Can you clarify what behavior you're looking for, and what you're seeing instead? It would also help if you explained which extension you're loading, and why you're only opening one window but then trying to close the second window. – Joe White Nov 22 '18 at 15:34
  • @JoeWhite White Extension is Adblock Plus. And when this extension is installed, Chrome create a new tab and other tab (youtube) dont start video. So this is necessary. When viewers play song on my computer, My Game minimized and chrome open – Evrenus Fırat Polat Nov 22 '18 at 15:46

0 Answers0