[英]How to change android chrome browser orientation using appium with Java
Im getting below exception while using below code 我在使用以下代码时遇到异常
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("deviceName","Android");
capabilities.setCapability("browserName", "Chrome");
capabilities.setCapability(CapabilityType.VERSION, "5.1.1");
capabilities.setCapability("platformName", "Android");
capabilities.setCapability(CapabilityType.ROTATABLE, true);
capabilities.setCapability(CapabilityType.PLATFORM, "WINDOWS");
driver = new AndroidDriver<>(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
driver.get("http://gmail.com");
((Rotatable) driver).rotate(ScreenOrientation.LANDSCAPE);
FAILED CONFIGURATION: @BeforeTest beforeTest org.openqa.selenium.WebDriverException: 失败的配置:@BeforeTest beforeTest org.openqa.selenium.WebDriverException:
unimplemented command: session/499d07270cddecd7890c7a909641ecf1/orientation
Command duration or timeout: 47 milliseconds
Build info: version: '2.43.1', revision: '5163bce', time: '2014-09-10 16:27:58'
System info: host: 'BALAP-HYD', ip: '10.144.22.34', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.8.0_31'
Driver info: io.appium.java_client.android.AndroidDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, chrome={}, takesHeapSnapshot=true, databaseEnabled=false, handlesAlerts=true, version=44.0.2403.133, platform=ANDROID, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]
Session ID: 499d07270cddecd7890c7a909641ecf1
轮换之前请尝试以下操作:
driver.context("NATIVE_APP");
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.