Skip to content
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

Add a "breakpoint" option for reconnecting in UC Mode #2385

Merged
merged 5 commits into from
Dec 23, 2023

Conversation

mdmintz
Copy link
Member

@mdmintz mdmintz commented Dec 23, 2023

Add a "breakpoint" option for reconnecting in UC Mode

Other unrelated changes:


More details:

Currently, some UC Mode methods let you set a custom reconnect_time / timeout (in seconds) to specify how long the driver should be disconnected from Chrome to prevent detection before reconnecting again. The new plan here is to add an option of "breakpoint" for that arg's value. Doing this should drop in a Python breakpoint() while the driver is disconnected from the browser. This will allow the user to perform manual actions (until typing c and pressing ENTER to continue from the breakpoint).

Here are those existing methods: (Use self.driver for BaseCase formats. Use sb.driver for SB() formats):

driver.uc_open_with_reconnect(url, reconnect_time)
# Examples:
driver.uc_open_with_reconnect("https://nowsecure.nl/#relax", reconnect_time=5)
driver.uc_open_with_reconnect("https://nowsecure.nl/#relax", 5)

driver.reconnect(timeout)
# Examples:
driver.reconnect(5)
driver.reconnect(timeout=5)

With this change, you'll now be able to set the reconnect_time / timeout to "breakpoint" as a valid option.

Instead of waiting for a set time, the program will run a Python breakpoint() so that the user will be able to continue when ready (using c + ENTER):

Examples that should work once this ticket is completed:

driver.uc_open_with_reconnect("https://nowsecure.nl/#relax", reconnect_time="breakpoint")
driver.uc_open_with_reconnect("https://nowsecure.nl/#relax", "breakpoint")

driver.reconnect(timeout="breakpoint")
driver.reconnect("breakpoint")

@mdmintz mdmintz added enhancement Making things better SeleniumBase 4 SeleniumBase 4 UC Mode / CDP Mode Undetected Chromedriver Mode / CDP Mode labels Dec 23, 2023
@mdmintz mdmintz self-assigned this Dec 23, 2023
@mdmintz mdmintz merged commit 9f8ce98 into master Dec 23, 2023
6 checks passed
@mdmintz mdmintz deleted the add-breakpoint-option-in-uc-mode branch December 23, 2023 05:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Making things better SeleniumBase 4 SeleniumBase 4 UC Mode / CDP Mode Undetected Chromedriver Mode / CDP Mode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a "breakpoint" option for the reconnect_time / timeout of UC Mode methods.
1 participant