Package org.openqa.selenium.chromium
Class ChromiumNetworkConditions
- java.lang.Object
-
- org.openqa.selenium.chromium.ChromiumNetworkConditions
-
public class ChromiumNetworkConditions extends java.lang.ObjectProvides manipulation of getting and setting network conditions from Chromium.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDOWNLOAD_THROUGHPUTstatic java.lang.StringLATENCYstatic java.lang.StringOFFLINEstatic java.lang.StringUPLOAD_THROUGHPUT
-
Constructor Summary
Constructors Constructor Description ChromiumNetworkConditions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetDownloadThroughput()The current throughput of the network connection in kb/second for downloading.java.time.DurationgetLatency()The current simulated latency of the connection.booleangetOffline()intgetUploadThroughput()The current throughput of the network connection in kb/second for uploading.voidsetDownloadThroughput(int downloadThroughput)Sets the throughput of the network connection in kb/second for downloading.voidsetLatency(java.time.Duration latency)Sets the simulated latency of the connection.voidsetOffline(boolean offline)Whether the network is set to offline.voidsetUploadThroughput(int uploadThroughput)Sets the throughput of the network connection in kb/second for uploading.
-
-
-
Field Detail
-
OFFLINE
public static final java.lang.String OFFLINE
- See Also:
- Constant Field Values
-
LATENCY
public static final java.lang.String LATENCY
- See Also:
- Constant Field Values
-
DOWNLOAD_THROUGHPUT
public static final java.lang.String DOWNLOAD_THROUGHPUT
- See Also:
- Constant Field Values
-
UPLOAD_THROUGHPUT
public static final java.lang.String UPLOAD_THROUGHPUT
- See Also:
- Constant Field Values
-
-
Method Detail
-
getOffline
public boolean getOffline()
- Returns:
- whether network is simulated to be offline.
-
setOffline
public void setOffline(boolean offline)
Whether the network is set to offline. Defaults to false.- Parameters:
offline- when set to true, network is simulated to be offline.
-
getLatency
public java.time.Duration getLatency()
The current simulated latency of the connection.- Returns:
- amount of latency, typically a Duration of milliseconds.
-
setLatency
public void setLatency(java.time.Duration latency)
Sets the simulated latency of the connection.- Parameters:
latency- amount of latency, typically a Duration of milliseconds.
-
getDownloadThroughput
public int getDownloadThroughput()
The current throughput of the network connection in kb/second for downloading.- Returns:
- the current download throughput in kb/second.
-
setDownloadThroughput
public void setDownloadThroughput(int downloadThroughput)
Sets the throughput of the network connection in kb/second for downloading.- Parameters:
downloadThroughput- throughput in kb/second
-
getUploadThroughput
public int getUploadThroughput()
The current throughput of the network connection in kb/second for uploading.- Returns:
- the current upload throughput in kb/second.
-
setUploadThroughput
public void setUploadThroughput(int uploadThroughput)
Sets the throughput of the network connection in kb/second for uploading.- Parameters:
uploadThroughput- throughput in kb/second
-
-