You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Up until now, CDP Mode hasn't had direct methods for simplifying the control of browser tabs. That's about to change. (One workaround has been to reconnect() to regular WebDriver to handle situations where tab-control is needed. Another workaround has been to call the async API indirectly.)
Note that with sb.cdp.switch_to_tab(tab), tab can be either an integer representing the list location from sb.cdp.get_tabs(), or it can be the actual Tab object from the list. If the tab you wish to switch to is the newest opened tab, you can just call sb.cdp.switch_to_newest_tab().
Once implemented, it'll be easy to switch tabs if a website opens a new tab after an action is performed.
The text was updated successfully, but these errors were encountered:
Add methods for handling tabs in CDP Mode
Up until now, CDP Mode hasn't had direct methods for simplifying the control of browser tabs. That's about to change. (One workaround has been to
reconnect()
to regular WebDriver to handle situations where tab-control is needed. Another workaround has been to call theasync
API indirectly.)The following methods will be added to CDP Mode:
To prevent confusion, the following methods will also be added as duplicates (because the regular SB naming scheme uses those):
Note that with
sb.cdp.switch_to_tab(tab)
,tab
can be either an integer representing the list location fromsb.cdp.get_tabs()
, or it can be the actualTab
object from the list. If thetab
you wish to switch to is the newest opened tab, you can just callsb.cdp.switch_to_newest_tab()
.Once implemented, it'll be easy to switch tabs if a website opens a new tab after an action is performed.
The text was updated successfully, but these errors were encountered: