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"

// Example of updating network conditions using constants
loaderoConstants.network.mobile_4g;

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"

// Example of setting a sample file using constants
setFile("input#file-upload", loaderoConstants.sampleFiles.png100KB;