Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS Appium on BrowserStack Falls Back to MSONWP instead of Using Expected W3C Protocol #4273

Closed
pablopaul opened this issue Jul 30, 2019 · 10 comments

Comments

@pablopaul
Copy link
Contributor

pablopaul commented Jul 30, 2019

Environment:

  • WebdriverIO version: 5.7.12
  • Mode: WDIO Testrunner
  • If WDIO Testrunner, running sync/async: async
  • Node.js version: v11.13.0
    NPM version: 6.10.1
  • Platform name and version: iOS 11.2
  • Additional wdio packages used (if applicable): appium service

Config of WebdriverIO

Local capabilities set through webdriverio which are working

config.capabilities = [
    {
        // The defaults you need to have in your config
        browserName: 'safari',
        platformName: 'iOS',
        maxInstances: 1,
        // For W3C the appium capabilities need to have an extension prefix
        // This is `appium:` for all Appium Capabilities which can be found here
        // http://appium.io/docs/en/writing-running-appium/caps/
        'appium:deviceName': 'iPhone X',
        'appium:platformVersion': '12.0',
        'appium:orientation': 'PORTRAIT',
        // `automationName` will be mandatory, see
        // https://github.com/appium/appium/releases/tag/v1.13.0
        'appium:automationName': 'XCUITest',
        'appium:newCommandTimeout': 240,
    },
];

The capabilities for BrowserStack are looking like this:

config.capabilities = [
    {   
        platformName: "iOS",
        deviceName: "iPhone X",
        browserName: "safari",
        'appium:automationName': 'XCUITest',
        'bstack:options' : {
            'deviceName' : 'iPhone X',
            'realMobile' : 'true',
        },
    },
];

Describe the bug

I try to run a test which sets timeouts (/timeouts endpoint) on iOS on BrowserStack through Appium 1.9.1.
I am using WebdriverIO as client library.

The test looks like:

describe('timeouts', () => {
    it('should be configurable', () => {
        browser.setTimeouts(1000, 2000, 3000);
    });
});

The test fails with Error: Parameters were incorrect. We wanted {"required":["type","ms"]} and you sent ["implicit","pageLoad","script"].

This is because on BrowserStack Appium detects MSONWP protocol, but the timeout format is only compatible with W3C protocol.

To Reproduce

Execute the test above against a real iOS device on BrowserStack.

Expected behavior

No error appears when using setTimeouts.

Log

Link to WebdriverIO log: https://gist.github.com/pablopaul/e08b68aaf6d4e622936eabc338e7bf0c

Link to Appium log: https://gist.github.com/pablopaul/6c2141d5023e65532ae838da84f15c10

@wswebcreation
Copy link
Member

@pablopaul

Is there a reason for using Appium 1.9.1? I know there is a fix with W3C and timeouts in 1.10.0, I don't know if that is related to this issue

@christian-bromann
Copy link
Member

It is. WebdriverIO sends a w3c command as it suppose to do with Appium given they support w3c within the latest versions. Please reach out to BS and ask how to use the latest version of Appium.

@pablopaul
Copy link
Contributor Author

@wswebcreation for the record I added the debug log to the issue (https://gist.github.com/pablopaul/e08b68aaf6d4e622936eabc338e7bf0c).

Currently the latest Appium version available on BrowserStack is v1.9.1.

@christian-bromann BS want to provide newer Appium version, but no ETA.

@wswebcreation
Copy link
Member

@pablopaul

It's a pity that BS isn't supporting the latest versions, Appium is already on version 1.14.0, meaning they are back behind a lot

@pablopaul
Copy link
Contributor Author

@wswebcreation

Yes, Appium 1.9.1 is almost a year old.

I contacted sales again.

@pablopaul
Copy link
Contributor Author

@wswebcreation

Anyway, locally I ran successfully setTimeouts() inside an iOS simulator and Appium 1.9.1 with WebdriverIO, meaning I could not even reproduce the error locally with the same Appium Version.

Maybe its the simulator vs real device, what do you think?

@wswebcreation
Copy link
Member

@pablopaul

I don't think it's related, I think it's more a BS thing, but maybe that's also because I'm a SL guy 😉

@amit-punjabi
Copy link

On Android execution, I am not facing this. However, on iOS this error is displayed.

Review the attached Appium logs - #iOS, #Android

seems like Safari cares about exact parameter string and Chrome does not. Check this

@pablopaul
Copy link
Contributor Author

@christian-bromann the issue is still existing, also with appium 1.14.0 which is now available on BrowserStack. What can I contribute / prepare to get this fixed?

@christian-bromann
Copy link
Member

The error is either in Appium in their iOS driver or still on BS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants