-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
[🐛 Bug]: driver.WindowHandles does not detect new tab opened by link or script in Selenium 4.26.0 (C#/.NET) #15703
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@shyampatadia, thank you for creating this issue. We will troubleshoot it as soon as we can. Selenium Triage Team: remember to follow the Triage Guide |
Closing this issue since similar issue was created earlier! |
Hi @selenium-ci , @shyampatadia, @navin772 , I'm still seeing the same issue on Chrome 136.0.7097.0 , as comments are disabled there (Not allowing me even if i have created the bug) #15703. May i know what is the exact resolution we are working on or do I need to create another bug on any other platform. |
I dont think this issue is resolved yet, I closed the bug assuming that the issue wont be there for the chromdriver 136.0.7097.0, but when I actually tried it, the issue is still there, one of the engineer on chromedriver bug, mentioned that its resolved, but it has not been resolved, for now I am just using browserversion < 133.0 |
Hi @AlokB1993, @shyampatadia can you share reproducible code for which you are facing the errors? |
Hi @navin772 , In the code snippet, this method line no. 111 we are opening a new window and switching to that and before switching i have stored the parent window handle to scenario context. And in line number 120 from the code snippet i have the window handle of the parent page. after execution of line 119(Which closes the new window after clicking on add button) when i try to switch back to parent page, i get the exception No such window. Please find the attached screenshot. |
@AlokB1993 I would need a minimal reproducible example (MRE) that I can run locally without the need of other dependent functions as in your code in order to find a resolution. Can you help me with that? |
@AlokB1993 that is not actionable at all. Screenshots give context but we need the actual code script to reproduce the issue. |
Hi @navin772 , Unfortunately i can't provide you the code because this is an inhouse project, but i can summarize all the steps which will reproduce the bug.
If you could find a dummy application which can replicate this functionality then it will be easy for us to reproduce the bug. |
@AlokB1993 you do not need to share the exact same code. Any code that reproduces the issue is enough. |
@AlokB1993 I wrote custom HTML that did exactly what you said above (in those 4 steps) and it works perfectly fine. |
|
I think it does not work with the extension that I am loading, I mean you might be trying without pdf.js extension, I can reproduce this, with loading the pdf.js extension. |
@shyampatadia in that case, I think the issue is with the extension, not selenium. If you have a script that will reproduce the error without the extension, I can take a look at it. |
Description
🐞 Bug Report:
driver.WindowHandles
does not detect new tab opened by link or script in Selenium 4.26.0 (C#/.NET)Summary:
In Selenium WebDriver version 4.26.0 for .NET (C#), the
driver.WindowHandles
property intermittently fails to detect new browser tabs opened via anchor links (target="_blank"
) or JavaScript triggers. This behavior was not observed in previous versions and leads toNoSuchWindowException
errors when switching to a newly opened tab using known working methods.💻 Environment:
✅ Expected Behavior:
After clicking a link that opens a new tab (e.g.,
target="_blank"
),driver.WindowHandles
should contain both the original and new tab window handles. CallingSwitchTo().Window()
with the correct handle should allow switching between them.❌ Actual Behavior:
driver.WindowHandles
continues to return only one handle, even after a second tab is visibly opened. This causes tab-switching logic based on partial window title or handle to fail.Reproducible Code
Use the `driver.WindowHandles` method when 2 tabs are opened, on a browser, it returns me only one handle, and not 2.
ℹ️ Last known working version:
4.26.0
The text was updated successfully, but these errors were encountered: