I am using selenium through python to automate a task - open a webpage, enter some text, click a button.
Now, once this is done, I want the browser to stay open and all the python files, the edgedriver.exe cmd window, and any other process ran by the python script to close. I want the browser to be loaded like a normal browser that we load manually.
My query:
- Can we stop the browser from closing when I close python program as well as the edgebrowser.exe? I have added this to my code, but this doesn't stop browser from closing once all other windows are closed.
code:
from selenium.webdriver.edge.options import Options
edge_options = Options()
edge_options.add_experimental_option("detach", True)
Using the detach option, I may be able to keep browser running with python closed. But I also do not want the edgebrowser.exe command window on the screen. Can we do that?
- Can we remove that line below the address line saying "Your browser is being controlled by an automation test software". I want the browser window to look like it does when we open it using the app/program shortcut.
.quit()
/.close()
the driver... problem solved.edge_options.add_argument("--remote-debugging-port=9222")
edge_options.add_experimental_option('useAutomationExtension', False)
edge_options.add_experimental_option("excludeSwitches", ["enable-automation"])
.