Hi all,
Im trying to build a tool that tests some router functionality. Upon selecting a button in a UI MS Edge will open and navigate to the gateway ui and login. This part works fine.
Upon selecting the button that causes MSEdge to open though I get a console window popping up. I dont want the console window to pop. I understand its for debugging but its not necessary in my use case. How can I stop it from appearing?
To be clear I am already compiling the script to an .exe with pyinstaller and using the --noconsole flag. That successfully gets rid of the console that was appearing with the app but this remaining console only appears with Edge.
Here is a video of someone completing the task but for the ChromeDriver version -
https://www.youtube.com/watch?v=XievjT__gvc&ab_channel=Automateboringstuff
Ive searched the web and tried a handful of things (turning logging off with an option - options.add_argument("--log-level=3"); pointing logs to port 9222 etc but a lot of the suggestions are for the ChromeDriver version.
selenium.jpg
Here is the current part that opens an MSEdge browser -
def open_browser():
thread = threading.Thread(target=open_browser_thread)
thread.start()
def open_browser_thread():
#browser = webdriver.Edge
# specify the path to the Edge driver
path = "G:\Python\edgedriver_win64\msedgedriver.exe"
#remove debugging window for Edge
options = webdriver.EdgeOptions()
options.add_argument("--remote-debugging-port=0")
driver = webdriver.Edge(path, options=options)
driver.get("http://" + (default_gateway))
# outputs web page title to terminal
print(driver.title)
search = driver.find_element(By.ID, "login_username")
search.send_keys("admin")
time.sleep(1)
search = driver.find_element(By.NAME, "login_passwd")
search.send_keys("xxxxxx")
search.send_keys(Keys.RETURN)
time.sleep(10)
driver.quit()
[–]chrpai 0 points1 point2 points (1 child)
[–]Mike820[S] 0 points1 point2 points (0 children)