-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Keeping browser tabs open even after tests #1814
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@NexusDC72 Use a breakpoint to keep the browser window open. import pdb; pdb.set_trace() Breakpoint common controls: When you're done with the browser window, use If you're looking to keep the browser window open between tests (and then only close it after the last test), then use Or if you're just using the Driver Manager without the rest of the framework APIs, this might work (the browser should stay open unless you quit it directly, but this format doesn't have access to BaseCase methods): from seleniumbase import Driver
driver = Driver(browser="chrome", headless=False) But using breakpoints is probably the best way, and it works with any of the formats. |
Thanks for the response and labeling this discussion, just a follow up question, I'll be running the script generated via the sbase recorder feature so I believe I'll need both the Driver Manager to keep the browser window open and the generated BaseCase methods. So to that can I use the "from seleniumbase import SB" i.e. sb.click() function with the Driver Manager solution you described above? And sorry to ask but what about get_new_driver() method specially for implementing chrome_options.add_experimental_option("detach", True), how would I go about using that? If you have any tutorials or links for keeping the browser window open I'll appreciate it. |
The SeleniumBase Recorder uses the BaseCase format (https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/syntax_formats.md#sb_sf_01). Drivers spun up by |
Cool thanks once more for the response including this wonderful tool 👍 |
Hi, newbie to Seleniumbase framework and searched the web with no luck so I'd like to request how to use custom chrome options through the .add_experimental_option("') method similar to the affect of:
from selenium.webdriver import ChromeOptions, Chrome
opts = ChromeOptions()
opts.add_experimental_option("detach", True)
driver = Chrome(chrome_options=opts)
So that the web browser tab that opens through the Seleniumbase framework on python stays open.
The text was updated successfully, but these errors were encountered: