How i can evaluate an ASYNC script in cdp mode? #3553
-
| In the normal mode, I have the  But when using CDP I only have the   How I can await a Promise from a script using cdp mode? | 
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
| 
 Is this intended? | 
Beta Was this translation helpful? Give feedback.
-
| See the  SeleniumBase/examples/cdp_mode/raw_async.py Lines 8 to 12 in 8317bc8 You have to stay in the same tab for CDP Mode. | 
Beta Was this translation helpful? Give feedback.

See the
asyncexample for utilizingawait: SeleniumBase/examples/cdp_mode/raw_async.py:SeleniumBase/examples/cdp_mode/raw_async.py
Lines 8 to 12 in 8317bc8
You have to stay in the same tab for CDP Mode.
If you want to switch between tabs, you have to reconnect the driver with
sb.connect()first.Here are a few examples that mix CDP Mode with WebDriver to do that:
SeleniumBase/examples/cdp_mode/raw_easyjet.py
Line 29 in 8317bc8
SeleniumBase…