question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android: Cannot call non W3C standard command while in W3C mode

See original GitHub issue

The problem

On trying to create a new android session, i am seeing this message after the session gets created. Unknown command: Cannot call non W3C standard command while in W3C mode

I don’t see this issue if i remove the capability: dc.setCapability(MobileCapabilityType.AUTO_WEBVIEW, true);

Switiching to webview works if i use driver.setContext() and i do not see W3C error. But the error is seen with doesn’t work with AutoWebview.

I am using java client 7.2.0 in this process

Environment

  • Appium version (or git revision) that exhibits the issue: v1.15.0-beta.1
  • Node.js version (unless using Appium.app|exe): v10.16.2
  • Npm or Yarn package manager: 6.9.0
  • Mobile platform/version under test: 7.0
  • Real device or emulator/simulator: Moto G4
  • Java Client : 7.2.0

Details

Desired capabilities:

            DesiredCapabilities dc = new DesiredCapabilities();
            if(aut.equalsIgnoreCase("android")){
                dc.setCapability(MobileCapabilityType.DEVICE_NAME, "Moto G4");
                dc.setCapability(MobileCapabilityType.AUTOMATION_NAME, "uiautomator2");
                dc.setCapability(MobileCapabilityType.PLATFORM_VERSION, "7.0");
                dc.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, 500);
                dc.setCapability(MobileCapabilityType.APP, System.getProperty("user.dir")+"/app/xxx.apk");
                dc.setCapability(MobileCapabilityType.AUTO_WEBVIEW, true);
                dc.setCapability(MobileCapabilityType.FORCE_MJSONWP, true);
                dc.setCapability(AndroidMobileCapabilityType.AUTO_GRANT_PERMISSIONS, true);
                dc.setCapability(AndroidMobileCapabilityType.SUPPORTS_ALERTS,true);
                driver = new AndroidDriver<WebElement>(new URL("http://127.0.0.1:4723/wd/hub"), dc);
            }

Link to Appium logs

https://gist.github.com/mayureshshirodkar/cf37d78bbdb847457914d667a3ada519

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:23 (3 by maintainers)

github_iconTop GitHub Comments

17reactions
mykola-mokhnachcommented, Oct 10, 2019

@roddymunro Wow, so complicated. How about

capabilities.setCapability("appium:chromeOptions", ImmutableMap.of("w3c", false));
8reactions
benken-parasoftcommented, Oct 7, 2019

This worked for me with ChromeDriver 76:

DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "Android");
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "Android");
capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, "Chrome");
capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, "UiAutomator2");
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.setExperimentalOption("w3c", false);
capabilities.merge(chromeOptions);
driver = new AndroidDriver<>(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot call non W3C standard command while in W3C mode ...
implies that the ChromeDriver was unable to call non W3C standard command while in W3C mode while initiating/spawning a new WebBrowser i.e. Chrome...
Read more >
Getting an error Cannot call non W3C standard command ...
When running my test script, I am getting the below mentioned error on this command : int deviceHeight = driver.manage().window().getSize().
Read more >
Trying to get the current webdriver instance is displaying ...
Trying to get the current webdriver instance is displaying 'Cannot call non W3C standard command while in W3C mode' error.
Read more >
W3C mod can't use TouchActions - Appium Discuss
I want to run selenium tests on Android device and I'm using Appium, ... command: Cannot call non W3C standard command while in...
Read more >
webdriverio/webdriverio - Gitter
Hi guys, i read a lot of us had issues like this "unknown command: Cannot call non W3C standard command while in W3C...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found