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.getSampleFiles()
getNetwork()
Network mode | Getter | String value |
---|---|---|
Default | getDefault() | "default" |
4G | getMobile4G() | "4g" |
3.5G/HSPDA | getMobileHSDPA() | "hsdpa" |
3G | getMobile3G() | "3g" |
GPRS | getMobileGPRS() | "gprs" |
Edge | getMobileEdge() | "edge" |
High jitter | getJitter() | "jitter" |
High latency | getLatency() | "latency" |
Asymmetric | getAsymmetric() | "asymmetric" |
Satellite phone | getSatellite() | "satellite" |
5% packetloss | getPacketLoss5() | "5packet" |
10% packetloss | getPacketLoss10() | "10packet" |
20% packetloss | getPacketLoss20() | "20packet" |
50% packetloss | getPacketLoss50() | "50packet" |
100% packetloss | getPacketLoss100() | "100packet" |
Custom | getCustom() | "custom" |
Network constants need to be used as arguments for the
updateNetwork
custom command.
// Example of updating network conditions using constants
updateNetwork(
loaderoConstants
.getNetwork()
.getMobile4G()
);
getSampleFiles()
Sample file | Getter | String 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 (TXT) | getTXT100MB() | "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(byCssSelector("input[type=FILE]"),
loaderoConstants
.getSampleFiles()
.getPNG100KB()
);