1

When I run my selenium application, a cmd window pops up, followed by a chrome window. I want to hide the cmd window. So far I have tried code from this website and code from this question. None of them helped. I also found someone trying to do this is C#. He seemed to find a solution. Is there a way to do this in python with selenium chromedriver? Here is a picture of the cmd window:

cmd window that pops up

I also want to make it clear that the app runs completely fine with this window open. I just think the app would more usable without it.

Thanks for your time and help.

1 Answers1

0

I met the same problem. Change a parameter value actually works for me.

Location: inside virtual environment \Lib\site-packages\selenium\webdriver\common, find the services.py file.
Find the start() function, add parameter creationflags=134217728.

   self.process = subprocess.Popen(cmd, env=self.env,
                                   close_fds=platform.system() != 'Windows',
                                   stdout=self.log_file,
                                   stderr=self.log_file,
                                   stdin=PIPE,creationflags=134217728)
Leo_Liu
  • 37
  • 5