How to update Sauce Labs custom profile for W3C compliance

Pre-Appium 2.0 tests run fine on Sauce Labs using the instructions here: Sauce Labs Integration | Katalon Docs.

However Appium 2.0 and later (e.g. iOS16 tests) requires W3C protocol instead of JWP: https://support.saucelabs.com/hc/en-us/articles/4412359870231-Migrating-Appium-Tests-to-W3C

Basically this means the capabilities node is used instead of desiredCapabilities. I don’t see how to do this though. Here’s an example snippet I’ve tried using:

{
“REMOTE_WEB_DRIVER”: {
“platformName”:“iOS”,
“browserName”:“Safari”,
“deviceName”:“iPhone 11 Pro Max Simulator”,
“platformVersion”:“16.1”,
“remoteWebDriverUrl”:“https://USER_NAME:ACCESS_KEY@ondemand.us-west-1.saucelabs.com:443/wd/hub
},
“capabilities”: {
“firstMatch”: [
{
“platformName”: “iOS”,
“browserName”:“Safari”,
“appium:deviceName”:“iPhone 11 Pro Max Simulator”,
“appium:platformVersion”:“16.1”,
“appium:automationName”:“XCUITest”,
“sauce:options”: {
“appiumVersion”:“2.0.0”,
“build”:“BUILD_NAME”,
“name”:“TEST_NAME”,
“username”:“USER_NAME”,
“accessKey”:“ACCESS_KEY”,
“remoteWebDriverUrl”:“https://ondemand.us-west-1.saucelabs.com:443/wd/hub”,
“remoteWebDriverType”:“Appium”
}
}
]
}
}

No dice though. It seems like only desiredCapabilities gets passed to Sauce Labs, and capabilities gets ignored. I don’t see this specific issue discussed elsewhere. Has anybody figured out how to make custom profiles work with W3C specs?

hi @heckdarnius, Did you try to generate a config by this link? Then you can create new a keyword to create or update the config in the custom profile to run Sauce Labs

Hi @duc.tnguyen,

Yes values used in the above snippet were generated from the Sauce Labs platform configurator. Those values were used in the Katalon Studio custom profile config, which is what the snippet is from.

Using that snippet, the test runs fine in Sauce Labs on pre-Appium 2.0 (i.e. JWP) configs. However only the desiredCapabilities node gets transmitted to Sauce Labs by Katalon Studio. The capabilities node gets ignored. As a result, the test will not run on Appium 2.0 (i.e. W3C) configs.

Here is part of a log from a test running using this config, which shows this behavior. Please notice that desiredCapabilities values are passed in the log, but not capabilities values:

2022-12-30 08:34:04.905 INFO com.kms.katalon.core.util.KeywordUtil - [SAUCELABS] Current run configuration: saucelabs_safari_ios_even_iphone_wide
2022-12-30 08:34:04.911 INFO com.kms.katalon.core.util.KeywordUtil - [SAUCELABS] Saucelabs Plugin will attempt to auto update job status and information if the test case is not skipped!
2022-12-30 08:34:05.293 DEBUG testcase.Feature Set - 1: pageURL = LD_Domain + LD_GuestExperience
2022-12-30 08:34:05.295 DEBUG testcase.Feature Set - 2: openBrowser(SSO_login, OPTIONAL)
2022-12-30 08:34:05.456 INFO c.k.k.c.w.util.WebDriverPropertyUtil - User set preference: [‘platformName’, ‘iOS’]
2022-12-30 08:34:05.457 INFO c.k.k.c.w.util.WebDriverPropertyUtil - User set preference: [‘browserName’, ‘Safari’]
2022-12-30 08:34:05.457 INFO c.k.k.c.w.util.WebDriverPropertyUtil - User set preference: [‘deviceName’, ‘iPhone 11 Pro Max Simulator’]
2022-12-30 08:34:05.457 INFO c.k.k.c.w.util.WebDriverPropertyUtil - User set preference: [‘platformVersion’, ‘15.2’]
2022-12-30 08:34:05.458 INFO c.k.k.c.w.util.WebDriverPropertyUtil - User set preference: [‘build’, ‘Global’]
2022-12-30 08:34:05.458 INFO c.k.k.c.w.util.WebDriverPropertyUtil - User set preference: [‘name’, ‘global test’]
2022-12-30 08:34:05.464 INFO c.k.k.core.webui.driver.DriverFactory - Connecting to remote web server ‘ondemand.us-west-1.saucelabs.com/wd/hub’ with type ‘Selenium’
2022-12-30 08:34:05.992 INFO c.k.k.core.webui.driver.DriverFactory - Action delay is set to 0 milliseconds
Dec 30, 2022 8:35:51 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: OSS
2022-12-30 08:35:51.590 INFO c.k.k.core.webui.driver.DriverFactory - remoteDriverUrl = https://USER_NAME:ACCESS_KEY@ondemand.us-west-1.saucelabs.com:443/wd/hub
2022-12-30 08:35:51.592 INFO c.k.k.core.webui.driver.DriverFactory - desiredCapabilities = {
“backendRetries”: 4,
“bootstrapPath”: “/Volumes/Sauce/wda/wda-v1.22.3-xcode13.0/WebDriverAgent”,
“browserName”: “Safari”,
“databaseEnabled”: false,
“derivedDataPath”: “/Volumes/Sauce/wda/wda-v1.22.3-xcode13.0/WebDriverAgent/DerivedData/WebdriverAgent”,
“deviceName”: “iPhone 11 Pro Max”,
“eventTimings”: true,
“hasMetadata”: true,
“javascriptEnabled”: true,
“keepKeyChains”: true,
“launchTimeout”: 180000,
“locationContextEnabled”: false,
“maxTypingFrequency”: 8,
“networkConnectionEnabled”: false,
“newCommandTimeout”: 0,
“noReset”: true,
“orientation”: “PORTRAIT”,
“platform”: “MAC”,
“platformName”: “MAC”,
“platformVersion”: “15.2”,
“preventWDAAttachments”: true,
“showIOSLog”: false,
“takesScreenshot”: true,
“udid”: “UDID”,
“usePrebuiltWDA”: true,
“webStorageEnabled”: false,
“webdriver.remote.quietExceptions”: false,
“webdriver.remote.sessionid”: “SESSIONID”
}
2022-12-30 08:35:51.592 INFO c.k.k.core.webui.driver.DriverFactory - sessionId = SESSIONID
2022-12-30 08:35:52.732 INFO c.k.k.core.webui.driver.DriverFactory - browser = Safari 15
2022-12-30 08:35:52.732 INFO c.k.k.core.webui.driver.DriverFactory - platform = Windows 10
2022-12-30 08:35:52.733 INFO c.k.k.core.webui.driver.DriverFactory - seleniumVersion = 3.141.59
2022-12-30 08:35:52.733 INFO c.k.k.core.webui.driver.DriverFactory - proxyInformation = ProxyInformation { proxyOption=NO_PROXY, proxyServerType=HTTP, username=, password=********, proxyServerAddress=, proxyServerPort=0, executionList=“”, isApplyToDesiredCapabilities=false }

I don’t see a way to address this issue in Katalon Studio’s Project Settings → Desired Capabilities → Custom. I have also tried manually editing the \settings\external\execution file. It just seems like Katalon ignores capabilities and only sends desiredCapabilities. Can you provide any insight about why that is the case?

Hi @Katalon_team! I’m still hoping for some help with this problem. Recap: following the instructions at Sauce Labs Integration doesn’t work for Appium 2.0 and later (earlier Appium versions still work great though :slight_smile: ). Is there some documentation for current Appium/W3C compliance?

I’m still hoping for feedback from the @Katalon_team on this issue. Is there any plan for Katalon Studio to support W3C Webdriver Protocol in custom profiles?

My team is required to use Sauce Labs. If KSE can’t work with newer Sauce Labs configurations, then we’ll need to work with a different tool to cover those areas. Thanks in advance for any insights!