NetworkInterceptor when new window is opened

39 views
Skip to first unread message

Alan Guy

unread,
Jul 16, 2025, 10:56:13 PMJul 16
to Selenium Users
I'm running into an issue with the NetworkInterceptor functionality in selenium webdriver when a new window is opened in the browser. The devtools reference seems to be attached to the original window, so no Network traffic is captured from the newly opened window. 

Is there a way to update the devtools reference to the new window to capture network traffic?


This email and any files transmitted with it are for the use of the intended recipient(s) only. If you have received this email in error, please notify the sender immediately and then delete it. If you are not the intended recipient, you must not keep, use, disclose, copy or distribute this email and any files transmitted with it without the sender's prior written permission. The information contained in this communication is confidential and proprietary information of Beyond Finance, LLC. and its Affiliates. 

Lior Weiss

unread,
Sep 24, 2025, 8:28:33 AMSep 24
to Selenium Users
You need to use the .WindowHandles object.
$Driver.SwitchTo().Window("$($Driver.WindowHandles.Item($Driver.WindowHandles.Count-1))")  will get you to the last opened window.

If you're using .Net, I'll be happy to know how you got your Network interceptor :)
Reply all
Reply to author
Forward
0 new messages