I have a web application running on a local machine, which is also running a stub application on localhost. This web application is accessible using a public url, which Katalon uses to test the application.
I am currently running this stub application inside the Katalon TestOps instance using ‘command.execute(java -jar stub.jar)’. This is not the recommended way according to Katalon. I should use a tunnel which should enable me to access the stub application running on a different server.
My question is: it seems that using a tunnel is running all my tests via the tunnel instead of just using the tunnel to access my stub application. Is that a correct assumption? And is it possible to point to my stub application through the tunnel and test the web application using TestOps (without using the tunnel)? How do I configure that?
3 Likes
Pumping this up for others to help!
1 Like
Yes, your assumption is correct by default. When you enable the TestCloud Tunnel, all traffic for the test session is typically routed through it.
How to Achieve Selective Tunneling
To point only the stub application through the tunnel and test the main application without it, you must use the Static Forwarding Mode of the TestCloud Tunnel.
-
Configure: Use the TestCloud Tunnel CLI (kt) to set the forwarding mode to static and define a port forwarding rule for your stub application’s local address and port.
Example: Route traffic from a TestCloud port (e.g., 50001) to your local stub (127.0.0.1:8080).
-
Update Script: In your test script, access the stub application using the forwarded port and localhost (e.g., http://localhost:50001/``...).
Result: Requests to the stub will be routed through the tunnel, while requests to your public web application URL will bypass the tunnel.