Package com.vaadin.flow.testutil
Class DevToolsWrapper
- java.lang.Object
-
- com.vaadin.flow.testutil.DevToolsWrapper
-
public class DevToolsWrapper extends Object
Controls browser network conditions through the Chrome DevTools Protocol.The CDP commands are built by hand rather than through the generated
org.openqa.selenium.devtools.vNNNclasses or the version-independentDomainsfacade in front of them. Selenium picks a generated implementation by matching the browser major version against the CDP implementations it bundles, and it only ever falls back to an implementation older than the browser. A Selenium release bundles the few newest Chrome versions, so a browser older than all of them matches nothing and resolves to a no-op implementation that throws on every call. The commands used here are part of the stable CDP surface and are sent over the raw connection, which makes them work with any Chrome version.
-
-
Constructor Summary
Constructors Constructor Description DevToolsWrapper(org.openqa.selenium.WebDriver driver)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidsetCacheDisabled(Boolean isDisabled)Controls the `Disable cache` option in DevTools via the corresponding Selenium API.voidsetOfflineEnabled(Boolean isEnabled)Controls the throttling `Offline` option in DevTools via the corresponding Selenium API.
-
-
-
Method Detail
-
setOfflineEnabled
public void setOfflineEnabled(Boolean isEnabled)
Controls the throttling `Offline` option in DevTools via the corresponding Selenium API.- Parameters:
isEnabled- whether to enable the offline mode.
-
setCacheDisabled
public void setCacheDisabled(Boolean isDisabled)
Controls the `Disable cache` option in DevTools via the corresponding Selenium API.- Parameters:
isDisabled- whether to disable the browser cache.
-
close
public void close()
-
-