0
クロムがセレンで提供するモバイルエミュレータを自動化しようとしていますが、現時点で直面している問題は、ブラウザが間違ったデバイスメトリックで開くことです。特に高さと幅を設定しようとしていますが私は次のようなエラーになっていますがセレンのChromeモバイルエミュレータのデバイスメトリクスパラメータを設定するにはどうすればよいですか?
Map<String, Object> deviceMetrics = new HashMap<String, Object>();
deviceMetrics.put("width", 360);
deviceMetrics.put("height", 640);
Map<String, Object> mobileEmulation = new HashMap<String, Object>();
mobileEmulation.put("deviceMetrics", deviceMetrics);
mobileEmulation.put("deviceName", "Nexus 5");
Map<String, Object> chromeOptions = new HashMap<String, Object>();
chromeOptions.put("mobileEmulation", mobileEmulation);
DesiredCapabilities capabilityMob = DesiredCapabilities.chrome();
capabilityMob.setCapability(ChromeOptions.CAPABILITY, chromeOptions);
this.driver = new RemoteWebDriver(_url, capabilityMob);
:ここに任意の運なしに私のコードです
org.openqa.selenium.WebDriverException: unknown error: cannot parse capability: chromeOptions from unknown error: cannot parse mobileEmulation from unknown error: 'deviceName' must be used alone