Is there any way that I can simulate network bandwidth and latency according to 2g/3g/4g networks while running the test?
Katalon (and Appium too) still not supported to control network bandwidth yet. But if you really need to see how your app works under different network conditions, you could use some tool to limit your network like in this article: Simulating Different Network Conditions For Virtual Devices (for Mac). On Windows, you could try some alternate tools like How to Limit Any Application’s Bandwidth on Windows.
With a real device, you will need to set up a proxy, limit the bandwidth of that proxy. And then redirect the network traffic of your real device through that proxy. (You could easily find the instructions to do this on google. It just takes time…).
If you’re not familiar with this, it could be a little bit hard. But after you know how to control the network, you could do many things with that later /=)
In my mobile tests I have created some ‘precondition’ or separate tests that will go into ‘Settings > Network & Internet > Mobile network > Preferred network type’ on the device and change this from 4G (recommended) to 3G or 2G.
This is run at the beginning of the test to set the network type on the device and then the test continues running on that network type. Hope this makes sense or helps you out