Currently working on Mobile Responsive automation testing using Appium 8.0.0 and selenium 4.1.2 version and I could able to invoke the device and load the application url also but when tried to get the title of the web application which is launched in Android chrome browser, getting the below error: "Exception in thread "main" org.openqa.selenium.UnsupportedCommandException: The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource"
Please find below the code snippet that is used.
ChromeOptions browserOptions = new ChromeOptions();
browserOptions.addArguments("use-fake-device-for-media-stream");
browserOptions.addArguments("use-fake-ui-for-media-stream");
Map<String, Object> sauceOptions = new HashMap<>();
sauceOptions.put("name", "Android Chrome Sample Test");
sauceOptions.put("tunnelIdentifier", "gopinath_tunnel");
sauceOptions.put("parentTunnel", "oauth-engineering-8859e");
sauceOptions.put("name", "Android Chrome Sample Test");
MutableCapabilities caps = new MutableCapabilities();
caps.setCapability("appium:deviceName", "Google Pixel 3a GoogleAPI Emulator");
//caps.setCapability("orientation", "portrait");
caps.setCapability("browserName", "Chrome");
caps.setCapability("appium:platformVersion", "12.0");
caps.setCapability("platformName", "Android");
caps.setCapability(ChromeOptions.CAPABILITY, browserOptions);
caps.setCapability("sauce:options", sauceOptions);
URL url = new URL(
"https://<Sauclabs username and accesskey>:443/wd/hub");
driver = new AndroidDriver(url, caps);
driver.get("<Application URL>");
Thread.sleep(5000);
//to allow the location popup
driver.context("NATIVE_APP");
driver.findElement(By.xpath(".//android.widget.Button[@text='Allow']")).click();
System.out.println("Pop up allow is clicked successfully");
driver.getTitle(); // not executing this line and throwing the mentioned error.
Also getting error when trying to switch tabs, getCurrentUrl() and some more methods when used.
I guess the issue is because of W3C compliant but not sure how to resolve this. Could anyone please help or guide me to resolve the above mentioned issue??