Skip to content

AttributeError: 'NoneType' object has no attribute 'bring_active_window_to_front' error using Seleniumbase #3455

Answered by mdmintz
ZcodeZ777 asked this question in Q&A
Discussion options

You must be logged in to vote

When activating UC Mode from multiple drivers, try it like this:

from seleniumbase import BaseCase
BaseCase.main(__name__, __file__, "--uc")

class MultipleDriversTest(BaseCase):
    def test_multiple_drivers(self):
        url1 = "https://seleniumbase.io/demo_page"
        self.activate_cdp_mode(url1)
        url2 = "https://seleniumbase.io/coffee/"
        driver2 = self.get_new_driver(undetectable=True)
        self.activate_cdp_mode(url2)
        self.sleep(2)
        self.switch_to_default_driver()
        print(self.get_current_url())
        self.sleep(2)
        self.switch_to_driver(driver2)
        print(self.get_current_url())

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mdmintz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants