![](/img/trans.png)
[英]how to change file download location in Webdriver while using chrome driver/firefox driver
[英]How to automate file downloads, while using chrome emulator (chrome driver) with device apple iPhone 5?
是否可以通过使用硒网络驱动程序的设备iPhone 5与Chrome模拟器一起使用Chrome模拟器来自动下载文件,就像我们在chrome或firefox驱动程序中所做的那样?
任何帮助..非常感谢!
根据您的需要,可以选择使用Browserstack( https://www.browserstack.com/ ),您可以模拟iPhone(以及大多数其他设备),并且可以与Selenium很好地集成。 实际上,无需创建Chrome驱动程序,而是通过Browserstack创建一个远程驱动程序。 下面的例子:
DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability("browser", "IE");
caps.setCapability("browser_version", "7.0");
caps.setCapability("os", "Windows");
caps.setCapability("os_version", "XP");
caps.setCapability("browserstack.debug", "true");
WebDriver driver = new RemoteWebDriver(new URL(URL), caps);
driver.get("http://www.google.com");
element.sendKeys("BrowserStack");
element.submit();
System.out.println(driver.getTitle());
driver.quit();
从那里可以正常使用硒。 可以在这里找到有关使用Selenium进行设置的更多信息: https : //www.browserstack.com/automate/java
设置将文件下载到dir的功能按预期工作,就像在浏览器firefox和chrome中一样。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.