Constants

Constants #

To make writing test scripts easier, Loadero offers variety of constants which can be accessed via loaderoConstants object nested objects using dot notation. There are 2 objects of loaderoConstants:

  • loaderoConstants.network
  • loaderoConstants.sampleFiles

network #

Network modeConstantString value
Defaultdefault"default"
4Gmobile_4g"4g"
3.5G/HSPDAmobile_hsdpa"hsdpa"
3Gmobile_3g"3g"
GPRSmobile_gprs"gprs"
Edgemobile_edge"edge"
High jitterjitter"jitter"
High latencylatency"latency"
Asymmetricasymmetric"asymmetric"
Satellite phonesatellite"satellite"
5% packetlosspacketloss5"5packet"
10% packetlosspacketloss10"10packet"
20% packetlosspacketloss20"20packet"
50% packetlosspacketloss50"50packet"
100% packetlosspacketloss100"100packet"
Customcustom"custom"
// Example of updating network conditions using constants
loaderoConstants.network.mobile_4g;

sampleFiles #

Sample fileConstantString value
100 KB (PNG)png100KB"loaderoSample100KB.png"
1 MB (PNG)png1MB"loaderoSample1MB.png"
5 MB (PNG)png5MB"loaderoSample5MB.png"
30 MB (PNG)png30MB"loaderoSample30MB.png"
100 MB (TXT)txt100MB"loaderoSample100MB.txt"
// Example of setting a sample file using constants
setFile("input#file-upload", loaderoConstants.sampleFiles.png100KB;