Skip to content

[🐛 Bug]: Unable to capture current url and unable to close the child window with a PDF URL from version 4.31.0 #15595

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

Open
rojanayak opened this issue Apr 8, 2025 · 3 comments
Labels
A-needs-triaging A Selenium member will evaluate this soon! C-java Java Bindings D-chrome I-defect Something is not working as intended I-regression Something was working but we "fixed" it OS-windows

Comments

@rojanayak
Copy link

rojanayak commented Apr 8, 2025

Description

  1. Switching parent window to child window, which is opening with a PDF in Chrome Browser, which is the third tab in browser.
    Trying to capture the URL for PDF opening with new tab, getting a Chrome-extension URL.
    2.Trying to launching the captured URL, getting 'Test Script is failed with java.net.MalformedURLException: unknown protocol: chrome-extension'. This scenario worked fine until version 4.29.0.
  2. After switching to child window and doing refresh, Trying to capture the URL for PDF opening with new tab 'org.openqa.selenium.WebDriverException: Remote browser did not respond to getCurrentUrl' and 'org.openqa.selenium.NoSuchWindowException: no such window: target window already closed
    from unknown error: web view not found
    '.
  3. After switching to child window and doing refresh, Trying to capture the URL for PDF opening with new tab and Trying to launching the captured URL, getting 'org.openqa.selenium.WebDriverException: Remote browser did not respond to getCurrentUrl'.

Reproducible Code

String mainId = driver.getWindowHandle();
		driver.switchTo().window(new ArrayList<String>(driver.getWindowHandles()).get(2));
		Thread.sleep(2000);
		driver.navigate().refresh();
		Thread.sleep(3000);
	        String pdfUrl = driver.getCurrentUrl();
                driver.close();

Debugging Logs

org.openqa.selenium.NoSuchWindowException: no such window: target window already closed
from unknown error: web view not found
  (Session info: chrome=134.0.6998.166)
Build info: version: '4.31.0', revision: '1ef9f18787*'
System info: os.name: 'Windows Server 2019', os.arch: 'amd64', os.version: '10.0', java.version: '17.0.10'
Driver info: org.openqa.selenium.chrome.ChromeDriver

org.openqa.selenium.WebDriverException: Remote browser did not respond to getCurrentUrl
Build info: version: '4.31.0', revision: '1ef9f18787*'
System info: os.name: 'Windows Server 2019', os.arch: 'amd64', os.version: '10.0', java.version: '17.0.10'
Driver info: driver.version: RemoteWebDriver

ℹ️ Last known working version: 4.21.0 to 4.29.0

@rojanayak rojanayak added A-needs-triaging A Selenium member will evaluate this soon! I-defect Something is not working as intended labels Apr 8, 2025
@selenium-ci
Copy link
Member

@rojanayak, thank you for creating this issue. We will troubleshoot it as soon as we can.

Selenium Triage Team: remember to follow the Triage Guide

@github-actions github-actions bot added C-java Java Bindings D-chrome I-regression Something was working but we "fixed" it OS-windows labels Apr 8, 2025
@navin772
Copy link
Member

navin772 commented Apr 8, 2025

Hi @rojanayak, this might be related to #15318, this was fixed by chrome in version 136.0.7097.0 (currently in chrome beta), refer the comment here and this chromium issue tracker - https://issues.chromium.org/issues/396611138#comment21.

You can try running your tests against this version and see if its resolved.

@rojanayak
Copy link
Author

rojanayak commented May 6, 2025

Hi Team, tested the scenario to capture the current URL of a pdf opening in a new tab with the updated Chrome Version 136.0.7103.49 (Official Build) (64-bit) and Selenium 4.31.0, but getting the same exceptions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-needs-triaging A Selenium member will evaluate this soon! C-java Java Bindings D-chrome I-defect Something is not working as intended I-regression Something was working but we "fixed" it OS-windows
Projects
None yet
Development

No branches or pull requests

3 participants