...13import org.openqa.selenium.interactions.TouchScreen;14import org.openqa.selenium.mobile.NetworkConnection;15import org.openqa.selenium.mobile.NetworkConnection.ConnectionType;16import org.openqa.selenium.remote.FileDetector;17import org.openqa.selenium.remote.RemoteTouchScreen;18import org.openqa.selenium.remote.RemoteWebDriver;19import org.openqa.selenium.remote.html5.RemoteLocationContext;20import org.openqa.selenium.remote.html5.RemoteWebStorage;21import org.openqa.selenium.remote.mobile.RemoteNetworkConnection;2223public class ChromeDriver extends RemoteWebDriver implements LocationContext, WebStorage, HasTouchScreen, NetworkConnection {24 private RemoteLocationContext locationContext;25 private RemoteWebStorage webStorage;26 private TouchScreen touchScreen;27 private RemoteNetworkConnection networkConnection;2829 public ChromeDriver() {30 this(ChromeDriverService.createDefaultService(), new ChromeOptions());31 }3233 public ChromeDriver(ChromeDriverService service) {34 this(service, new ChromeOptions());35 }3637 /** @deprecated */38 @Deprecated39 public ChromeDriver(Capabilities capabilities) {40 this(ChromeDriverService.createDefaultService(), capabilities);41 }4243 public ChromeDriver(ChromeOptions options) {44 this(ChromeDriverService.createDefaultService(), options);45 }4647 public ChromeDriver(ChromeDriverService service, ChromeOptions options) {48 this(service, (Capabilities)options);49 }5051 /** @deprecated */52 @Deprecated53 public ChromeDriver(ChromeDriverService service, Capabilities capabilities) {54 super(new ChromeDriverCommandExecutor(service), capabilities);55 this.locationContext = new RemoteLocationContext(this.getExecuteMethod());56 this.webStorage = new RemoteWebStorage(this.getExecuteMethod());57 this.touchScreen = new RemoteTouchScreen(this.getExecuteMethod());58 this.networkConnection = new RemoteNetworkConnection(this.getExecuteMethod());59 }6061 public void setFileDetector(FileDetector detector) {62 throw new WebDriverException("Setting the file detector only works on remote webdriver instances obtained via RemoteWebDriver");63 }6465 public LocalStorage getLocalStorage() {66 return this.webStorage.getLocalStorage();67 }6869 public SessionStorage getSessionStorage() {70 return this.webStorage.getSessionStorage();71 }
...