Skip to main content

Configure network throttling

There might be scenarios where you would have to check the functionality of your website on poor network conditions or even offline. Such networks have variable upload and download speeds which can alter how your website performs on different browsers.

With Network throttling feature, you can test the performance and behavior of your website under different network conditions by simulating different network profiles.

To configure network throttling with TestCloud, follow these steps:

  1. Set the boolean enableNetworkThrottling=True desired capability for your project. See: Set desired capabilities for TestCloud environment.
  2. Declare a custom keyword class with the name ThrottleNetworkExecutor under the com.katalon.testcloud package.
    public class ThrottleNetworkExecutor {

    /**
    * set the network profile for test network on web.
    *
    * @param condition A string or object representing browser network conditions.
    *
    *
    */
    @Keyword
    void setNetworkProfileForWeb(String condition) {
    }

    /**
    * set the network profile for test network on Mobile.
    *
    * @param condition A string or object representing browser network conditions.
    *
    *
    */
    @Keyword
    void setNetworkProfileForMobile(String condition) {
    }

    @Keyword
    void customNetworkProfileForWeb(int downloadSpeed, int uploadSpeed, int latency) {
    }

    @Keyword
    void customNetworkProfileForMobile(int downloadSpeed, int uploadSpeed, int latency) {
    }
    }

    The ThrottleNetworkExecutor contains 4 keywords for the following use cases:

    setNetworkProfileForWeb: throttle network for web browsers by profile.
    Profile NameDownload SpeedUpload SpeedLatency
    offline0 Kbps0 Kbps0 ms
    GPRS50 Kbps20 Kbps500 ms
    Regular 2G250 Kbps50 Kbps300 ms
    Good 2G450 Kbps150 Kbps150 ms
    Regular 3G750 Kbps250 Kbps100 ms
    Good 3G1 Mbps750 Kbps20 ms
    Regular 4G 4 Mbps3 Mbps20 ms
    DSL2 Mbps1 Mbps5 ms
    setNetworkProfileForMobile: throttle network for mobile devices by profile.
    Profile NameDownload SpeedUpload SpeedLatency
    2g-gprs-poor20 Kbps6 Kbps1000 ms
    2g-gprs-good50 Kbps16 Kbps500 ms
    3g-umts-poor200 Kbps64 Kbps 400 ms
    4g-lte-poor 1 Mbps500 Kbps200 ms
    3g-umts-good5 Mbps2 Mbps100 ms
    4g-lte-good15 Mbps 7 Mbps70 ms
    4g-lte-advanced-good25 Mbps12 Mbps20 ms

    customNetworkProfileForWeb, customNetworkProfileForMobile: provide arbitrary values for network throttling.