我知道Firefox只适用于Gecko驱动程序,我使用此代码:
System.setProperty("webdriver.gecko.driver","C:\\Users\\Emml.u\\Downloads\\geckodriver-v0.10.0-win64\\geckodriver.exe");
DesiredCapabilities capabilities=DesiredCapabilities.firefox();
capabilities.setCapability("marionette", true);
但现在我想让我的RemoteWebDriver
使用与此类似的代码:
DesiredCapabilities capability = DesiredCapabilities.chrome();
capability.setBrowserName("chrome");
capability.setPlatform(Platform.WIN8_1);
capability.setCapability("screen-resolution", "1920x1080");
WebDriver driver = new RemoteWebDriver(new URL("http://XX.XX.XX.XX:4444/wd/hub"), capability);
driver.manage().window().setSize(new Dimension(1920, 1080));
有人可以告诉我如何实现这个目标吗?