Constants

Constants #

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

  • loaderoConstants.getNetwork()
  • loaderoConstants.getSamplesFiles()

getNetwork() #

Network modeGetterString value
DefaultgetDefault()"default"
4GgetMobile4G()"4g"
3.5G/HSPDAgetMobileHSDPA()"hsdpa"
3GgetMobile3G()"3g"
GPRSgetMobileGPRS()"gprs"
EdgegetMobileEdge()"edge"
High jittergetJitter()"jitter"
High latencygetLatency()"latency"
AsymmetricgetAsymmetric()"asymmetric"
Satellite phonegetSatellite()"satellite"
5% packetlossgetPacketLoss5()"5packet"
10% packetlossgetPacketLoss10()"10packet"
20% packetlossgetPacketLoss20()"20packet"
50% packetlossgetPacketLoss50()"50packet"
100% packetlossgetPacketLoss100()"100packet"
CustomgetCustom()"custom"
// Example of updating network conditions using constants
updateNetwork(
    loaderoConstants
        .getNetwork()
        .getMobile4G()
);

getSampleFiles() #

Sample fileGetterString value
100 KB (PNG)getPNG100KB()"loaderoSample100KB.png"
1 MB (PNG)getPNG1MB()"loaderoSample1MB.png"
5 MB (PNG)getPNG5MB()"loaderoSample5MB.png"
30 MB (PNG)getPNG30MB()"loaderoSample30MB.png"
100 MB (PNG)getTXT100MB()"loaderoSample100MB.txt"
// Example of setting a sample file using constants
setFile(byCssSelector("input[type=FILE]"),
    loaderoConstants
        .getNetwork()
        .getPNG100KB()
);