Skip to content

session not created on sauce labs for iOS using Selenium 4 #1690

@sonali9293

Description

@sonali9293

The problem

When using the below config, the session is not getting created and is throwing Null Pointer exception 'because the return value of "java.lang.ThreadLocal.get()" is null'

Environment

Appium version: 1.17.1
Appium (java-client): 8.0.0
Selenium 4.1.1

Details

N/A

Link to Appium logs

Attached Doc of log

Code To Reproduce Issue [ Good To Have ]

Here is the code for reference.

  • Capabilities

'MutableCapabilities caps = new MutableCapabilities();
caps.setCapability("platformName", os);
caps.setCapability("deviceOrientation", "portrait");
caps.setCapability("browserName", browser);
caps.setCapability("browserVersion", version);
caps.setCapability("appium:deviceName", devicename);
caps.setCapability("appium:platformVersion", platformversion);
MutableCapabilities sauceOptions = new MutableCapabilities();
sauceOptions.setCapability("name", methodName);
sauceOptions.setCapability("appiumVersion", "1.17.1");
if (buildTag != null) {
caps.setCapability("build", buildTag);
}
caps.setCapability("sauce:options", sauceOptions);

		if (browser.toLowerCase().contains("chrome")) {
			ChromeOptions options = new ChromeOptions();
			options.addArguments("disable-translate");
			options.addArguments("disable-translate-new-ux");
			caps.setCapability(ChromeOptions.CAPABILITY, options);
		}

		// Launch remote browser and set it as the current thread
		webDriver.set(new RemoteWebDriver(
				new URL("https://" + username + ":" + accesskey + "@ondemand.saucelabs.com:443/wd/hub"),
				caps));
		`

Apparently, this same is working all fine for android but only for ioS there is this issue. What am i missing ?

##Error occured:
java.lang.NullPointerException: Cannot invoke "org.openqa.selenium.JavascriptExecutor.executeScript(String, Object[])" because the return value of "java.lang.ThreadLocal.get()" is null
org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Unable to parse remote response:
Caused by: org.openqa.selenium.json.JsonException: Expected to read a START_MAP but instead have: END. Last 0 characters read:
Build info: version: '4.1.0', revision: '87802e897b'
System info: host: 'W105482ZY2', ip: '192.168.29.171', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '17.0.1'
Driver info: driver.version: RemoteWebDriver

log (1).txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions