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 mode | Constant | String value |
---|---|---|
Default | default | "default" |
4G | mobile_4g | "4g" |
3.5G/HSPDA | mobile_hsdpa | "hsdpa" |
3G | mobile_3g | "3g" |
GPRS | mobile_gprs | "gprs" |
Edge | mobile_edge | "edge" |
High jitter | jitter | "jitter" |
High latency | latency | "latency" |
Asymmetric | asymmetric | "asymmetric" |
Satellite phone | satellite | "satellite" |
5% packetloss | packetloss5 | "5packet" |
10% packetloss | packetloss10 | "10packet" |
20% packetloss | packetloss20 | "20packet" |
50% packetloss | packetloss50 | "50packet" |
100% packetloss | packetloss100 | "100packet" |
Custom | custom | "custom" |
Network constants need to be used as arguments for the
updateNetwork
custom command.
// Example of updating network conditions using constants
client.updateNetwork(loaderoConstants.network.mobile_3g);
sampleFiles
Sample file | Constant | String 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" |
Sample file constants need to be used as arguments for the
setFile
custom command
// Example of setting a sample file using constants
setFile("input#file-upload", loaderoConstants.sampleFiles.png100KB;