diff --git a/examples/raw_test_scripts.py b/examples/raw_test_scripts.py index 5e1950d5..3391f25b 100644 --- a/examples/raw_test_scripts.py +++ b/examples/raw_test_scripts.py @@ -1,7 +1,7 @@ """Context Manager Test. Runs with "python". (pytest not needed)""" from seleniumbase import SB -with SB(test=True) as sb: +with SB(test=True, uc=True) as sb: sb.open("https://google.com/ncr") sb.type('[name="q"]', "SeleniumBase on GitHub\n") sb.click('a[href*="github.com/seleniumbase"]') diff --git a/help_docs/syntax_formats.md b/help_docs/syntax_formats.md index 18d9202f..c3ab0f25 100644 --- a/help_docs/syntax_formats.md +++ b/help_docs/syntax_formats.md @@ -855,7 +855,7 @@ Here's another example, which uses test mode: ```python from seleniumbase import SB -with SB(test=True) as sb: +with SB(test=True, uc=True) as sb: sb.open("https://google.com/ncr") sb.type('[name="q"]', "SeleniumBase on GitHub\n") sb.click('a[href*="github.com/seleniumbase"]') diff --git a/seleniumbase/console_scripts/sb_mkdir.py b/seleniumbase/console_scripts/sb_mkdir.py index d4d13c62..84620456 100644 --- a/seleniumbase/console_scripts/sb_mkdir.py +++ b/seleniumbase/console_scripts/sb_mkdir.py @@ -631,10 +631,13 @@ def main(): data = [] data.append("from seleniumbase import BaseCase") data.append("from .google_objects import HomePage, ResultsPage") + data.append('BaseCase.main(__name__, __file__, "--uc")') data.append("") data.append("") data.append("class GoogleTests(BaseCase):") data.append(" def test_google_dot_com(self):") + data.append(" if not self.undetectable:") + data.append(" self.get_new_driver(undetectable=True)") data.append(' self.open("https://google.com/ncr")') data.append(' self.assert_title_contains("Google")') data.append(" self.sleep(0.05)") diff --git a/seleniumbase/plugins/driver_manager.py b/seleniumbase/plugins/driver_manager.py index fcba1045..72609637 100644 --- a/seleniumbase/plugins/driver_manager.py +++ b/seleniumbase/plugins/driver_manager.py @@ -10,7 +10,7 @@ Example --> ```python from seleniumbase import DriverContext -with DriverContext() as driver: +with DriverContext(uc=True) as driver: driver.get("https://google.com/ncr") ``` @@ -30,7 +30,7 @@ Example --> ```python from seleniumbase import Driver -driver = Driver() +driver = Driver(uc=True) driver.get("https://google.com/ncr") ``` diff --git a/seleniumbase/plugins/sb_manager.py b/seleniumbase/plugins/sb_manager.py index e934d0fe..b3081c0a 100644 --- a/seleniumbase/plugins/sb_manager.py +++ b/seleniumbase/plugins/sb_manager.py @@ -10,7 +10,7 @@ Example --> ```python from seleniumbase import SB -with SB() as sb: # Many args! Eg. SB(browser="edge") +with SB(uc=True) as sb: # Many args! Eg. SB(browser="edge") sb.open("https://google.com/ncr") sb.type('[name="q"]', "SeleniumBase on GitHub\n") sb.click('a[href*="github.com/seleniumbase"]')