Skip to content

New tabs opened in CDP Mode don't retain special configuration from the first tab #4121

@mdmintz

Description

@mdmintz

New tabs opened in CDP Mode don't retain special configuration from the first tab


Eg, if calling sb.cdp.open_new_tab(url) when special settings exist (such as changing geolocation), then the new tab doesn't retain those special settings from the first tab.

Once fixed, an example script such as the one below should work:

from seleniumbase import SB

with SB(uc=True, test=True) as sb:
    url = "https://www.openstreetmap.org/"
    sb.activate_cdp_mode(url, geoloc=(31.774390, 35.222450))
    sb.click('a[aria-label="Show My Location"]')
    sb.assert_url_contains("31.774390/35.222450")
    sb.sleep(5)
    sb.cdp.open_new_tab(url)
    sb.click('a[aria-label="Show My Location"]')
    sb.assert_url_contains("31.774390/35.222450")
    sb.sleep(5)

Metadata

Metadata

Assignees

Labels

UC Mode / CDP ModeUndetected Chromedriver Mode / CDP ModebugUh oh... Something needs to be fixed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions