Package org.openqa.selenium.chromium
Class ChromiumNetworkConditions
java.lang.Object
org.openqa.selenium.chromium.ChromiumNetworkConditions
Provides manipulation of getting and setting network conditions from Chromium.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
The current throughput of the network connection in kb/second for downloading.The current simulated latency of the connection.boolean
int
The current throughput of the network connection in kb/second for uploading.void
setDownloadThroughput
(int downloadThroughput) Sets the throughput of the network connection in kb/second for downloading.void
setLatency
(Duration latency) Sets the simulated latency of the connection.void
setOffline
(boolean offline) Whether the network is set to offline.void
setUploadThroughput
(int uploadThroughput) Sets the throughput of the network connection in kb/second for uploading.
-
Field Details
-
OFFLINE
- See Also:
-
LATENCY
- See Also:
-
DOWNLOAD_THROUGHPUT
- See Also:
-
UPLOAD_THROUGHPUT
- See Also:
-
-
Constructor Details
-
ChromiumNetworkConditions
public ChromiumNetworkConditions()
-
-
Method Details
-
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
The current simulated latency of the connection.- Returns:
- amount of latency, typically a Duration of milliseconds.
-
setLatency
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
-