Browser Stuck at data: URL Instead of Redirecting to Application URL

When I run a test case in any browser (Chrome or Edge), the browser launches and initially shows a data: URL in the address bar, but it doesn’t redirect to the application URL I’ve specified in the test case.

I tried running the same test on a different machine. There, the browser also briefly shows data:, but then quickly redirects to the correct application URL and the test proceeds as expected.

Has anyone experienced this behavior? Any idea what might be causing the browser not to redirect properly on my machine?

1 Like

hello there, could you share more information about the test keywords you are using?

to navigate to a URL the most common keyword isNavigateToURL but you can also use OpenBrowser and send the URL on its parameters.

Tipically this type of errors, happens when the URL is malformed or invalid in its structure.

After a recent upgrade of our servers, we had to send the request to connect twice as the first time often did not work. Maybe you might have to do the same.

WebUI.openBrowser(gHomeSite)

// like it better when see all the items
WebUI.maximizeWindow()

// need to do this again after move to upgrade server OS
WebUI.navigateToUrl(gHomeSite)
WebUI.waitForPageLoad(10)

or you can query if you have moved to your URL

WebUI.openBrowser(gHomeSite)

// like it better when see all the items
WebUI.maximizeWindow()

WebUI.delay(2)

if (!WebUI.getUrl().contains('WebClient/LogIn')) {
	WebUI.navigateToUrl(gHomeSite)
	WebUI.waitForPageLoad(10)
}

Hi @gmarichal, I used OpenBrowser followed by NavigateToURL for navigation. It worked correctly on another machine, but on mine, the browser doesn’t redirect to the specified URL. Any idea what might be causing this?

Hmmm have you tried @grylion54 alternative?

Based on what you said, that it worked in another machine, I guess it could be something with the network settings on that specific machine or in the Katalon Settings.

Do you have some network restrictions or set up that you dont have in the machine that worked? For example on the etc/host file (if windows).

The issue where the browser gets stuck on a data: URL instead of redirecting to your application URL is likely caused by an environment-specific problem on your machine. Here’s a structured approach to diagnose and resolve it:

1. Check WebDriver and Browser Compatibility

  • Ensure the WebDriver (e.g., ChromeDriver, MSEdgeDriver) matches the browser version on your machine. Mismatched versions often cause unexpected navigation issues.
  • Fix: Update WebDriver using tools like WebDriver Manager or manually download the correct version.

2. Disable Browser Extensions

  • Extensions (ad blockers, privacy tools) can interfere with automated scripts.
  • Test: Launch the browser in “clean” mode for testing:

python

# For Chrome
options = webdriver.ChromeOptions()
options.add_argument("--disable-extensions")

Or use headless mode temporarily.

3. Clear Browser Cache/State

  • Stale cookies or cached data might conflict with the redirect.
  • Action: Clear the browser’s cache, cookies, and storage before running tests.

4. Check Network/Proxy Settings

  • Ensure no proxy/firewall is blocking requests to the application URL.
  • Verify: Test the application URL manually in the browser. If it fails, check network configurations.

5. Review Browser Security Settings

  • Strict pop-up blockers, JavaScript settings, or SSL restrictions might prevent redirects.
  • Adjust: Temporarily disable security features like pop-up blocking in browser options.

6. Analyze Network Traffic

  • Use browser developer tools (F12) to monitor network activity during the test. Look for:
    • Failed HTTP requests to the application URL.
    • Console errors (JavaScript exceptions, CORS issues).

7. Test with Explicit Delays

  • Add a small wait after the initial data: URL load to handle timing issues:

python

from selenium.webdriver.support.ui import WebDriverWait
WebDriverWait(driver, 10).until(lambda d: d.current_url != "data:,")

8. Compare Environment Configurations

  • Differences between your machine and the working one (OS updates, Java/.NET versions, drivers, etc.) can cause discrepancies.

9. Temporarily Disable Security Software

  • Antivirus/firewall software might block automation scripts. Test with these disabled.

10. Inspect the Hosts File

  • Ensure the application URL isn’t being redirected locally (e.g., via C:\Windows\System32\drivers\etc\hosts).

Summary of Likely Causes (Prioritized):

  1. WebDriver/Browser Version Mismatch (Most common).
  2. Extensions/Security Settings blocking navigation.
  3. Network Restrictions (proxy/firewall) on your machine.

Start by verifying WebDriver compatibility and testing in a clean browser environment.

I would close all instances of the webdriver and then download again, making sure to use a version compatible with your installed browser. Download either with Katalon’s tool or by manually downloading and dropping into the drivers directory

your issue resolved?

No not yet, still facing the same issue, Cleared all cache and site data, turned off the Katalon extension, same thing, loads up a webpage with “data;,” in the URL and gets stuck there

Did you download a new webdriver, as I suggested?

Hello again!
@sjsppraveen have you tried using OpenBrowser or NavigateToURL to a different webPage? I would like to know if it is specifically related to the environment you are trying to access or if its a more general issue.

Also, are you facing any browser alert? like some security or certificate alert that may be shown once the browser is displayed?

It is still happening using different browsers? Like Chome, Firefox, Edge?

What I want to understand is the root cause here. Maybe if you provide us with this info. we can help you more.

Thanks!