appium / python-client

Python language bindings for Appium
Apache License 2.0
1.68k stars 563 forks source link

Unable to submit to Browserstack using v2.0.0 #818

Closed Timwintle1979 closed 1 year ago

Timwintle1979 commented 1 year ago

The problem

I have been using appiumlibrary version 1.5.0.6 for some time now but having migrated to python 3 and latest libraries where possible, I upgraded to 2.0.0. The issue I see is that when requesting tests via browserstack. It suggests that the "device" field is not being submitted (though I can see it in the post request)

Environment

Details

I have been using appium library alongside testing using the cloud based provider browserstack. This worked well until I upgraded to the latest version of appiumlibrary(2.0.0), I now receive an error back from browserstack consistently saying that the "device" is missing. I am aware that "device" has changed to "deviceName" in newer versions of appium and have tried both variants with the same error message being returned.

Observations I've had but can't disseminate

There appears to be additional content in the POST that now has "firstwatch" and "alwayswatch" this is new and "firstwatch" was only present on the earlier version

There doesn't appear to be any raw desired caps in the post against the test that isn't working (I've attached screenshots of both the working and non-working version by way of comparison.

I'm really sorry to raise an issue but I wasn't sure what else to do to get around this issue as my python skills are unfortunately very poor and I can't be 100% sure at this stage if this is user error or a genuine problem

Link to Appium Logs

Cloud based and logs not available as session does not start

Code To reproduce issue

Open Application https://${global_BrowserStackUsername}:${global_BrowserStackAccessKey}@hub-cloud.browserstack.com/wd/hub platformName=${global_PlatformName} appPackage=${global_AppPackage} appActivity=${global_AppActivity} noReset=False app_url=${exist_app_url} deviceName=${make} ${model} os_version=${version} acceptSslCerts=True build=${global_AppVersion} ${runDateTime} name=${SUITE_NAME} browserstack.idleTimeout=180

works dontwork

KazuCocoa commented 1 year ago

I guess the device capability needs the browserstack's vendor prefix. bs:device or something, please ask the customer support (since I'm not sure the vendor prefix).

as https://github.com/appium/python-client#quick-migration-guide-from-v1-to-v2, Python client v2 depends on Selenium v4 client, which expects W3C WebDriver protocol. It requires vendor prefix as the capability names, you can find the vendor prefix as appium:. I think some of them must be the browserstack's one.

Timwintle1979 commented 1 year ago

@KazuCocoa the error message was a bit of a red-herring in the end. The issue was being caused by using "app_url" rather than simply "app". I don't know if Appium used to have this support and have since got rid or what but it definately worked on 1.5.0.6 and then failed to work on 2.0.0 but its working now and that's all that really matters :-)

jlipps commented 1 year ago

appium never supported app_url. sounds like a browserstack issue combined with the change in the way selectors are required to conform to the w3c spec in appium 2.