When explaining this to the community, highlight that “Standard WebDrivers are stateless by design.” To provide a solution, you are moving from Local Execution to Remote Debugging Protocol (RDP). This shows you understand the underlying architecture of how browsers communicate with automation tools.
Here is the fix to achieve Session Reuse:
1. The “Talk”: Why it fails
Katalon usually looks for a specific Remote Debugging Port. If you just open Chrome manually, that port is closed. Katalon can’t “see” it. To fix this, you must launch the browser in debug mode.
2. The Solution: Use “Remote” Execution
Step A: Launch your browser manually via Command Line
You must open your browser (e.g., Chrome) with a debugging port enabled so Katalon can “hijack” it.
-
Close all Chrome instances.
-
Open your terminal/command prompt and run:
chrome.exe --remote-debugging-port=9222 --user-data-dir="C:\selenum\AutomationProfile"
(This opens a browser that is “listening” for Katalon).
Step B: Configure Katalon to “Attach”
Don’t use WebUI.openBrowser(). Use the Desired Capabilities to point to that port.
-
In Katalon, go to Project > Settings > Desired Capabilities > Web Service > Chrome (or your specific provider).
-
Add a property:
-
Name: debuggerAddress
-
Type: String
-
Value: localhost:9222
Step C: The Script Fix
In your test case, you still need to “start” the driver, but it will now attach to the open window instead of launching a new one:
groovy
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
// Do NOT pass a URL here, it will use the existing session
WebUI.openBrowser('')
WebUI.navigateToUrl('https://your-site.com')
Use code with caution.
3. The “Smart” Alternative: Debug from a Specific Step
If you just want to stop the test, fix code, and continue without restarting: