appium / appium/java-client

Getting Exception while trying to connect ios simulator with ios appium driver

Open
#1,197 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.3k
Forks
752
Avg merge
6d 21h
Merged PRs (30d)
8

Description

The problem

Getting the below exception

java.lang.NoSuchMethodError: org.openqa.selenium.remote.http.HttpClient$Factory.createDefault()Lorg/openqa/selenium/remote/http/HttpClient$Factory;
	at io.appium.java_client.remote.AppiumCommandExecutor.<init>(AppiumCommandExecutor.java:93)
	at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:95)
	at io.appium.java_client.ios.IOSDriver.<init>(IOSDriver.java:92)
	at com.comcast.xfinity.scenarios.TestIOSDriver.TestSafariOnIOS(TestIOSDriver.java:53)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:639)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:816)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1124)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
	at org.testng.TestRunner.privateRun(TestRunner.java:774)
	at org.testng.TestRunner.run(TestRunner.java:624)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:359)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:354)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:312)
	at org.testng.SuiteRunner.run(SuiteRunner.java:261)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1191)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1116)
	at org.testng.TestNG.run(TestNG.java:1024)
	at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:115)
	at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)
	at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)

Environment

  • Appium version (or git revision) that exhibits the issue: appium java client -7.1.0
  • Last Appium version that did not exhibit the issue (if applicable):
  • Desktop OS/version used to run Appium: macOS mojave v 10.14.5
  • Node.js version (unless using Appium.app|exe): 12.6.0
  • Npm or Yarn package manager: Npm
  • Mobile platform/version under test: IOS 12.4
  • Real device or emulator/simulator: Emulator
  • Appium CLI or Appium.app|exe: terminal

Code To Reproduce Issue [ Good To Have ]

package com.comcast.xfinity.scenarios;

import java.io.IOException;
import java.net.URL;
import java.util.concurrent.TimeUnit;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.annotations.Test;

import io.appium.java_client.ios.IOSDriver;

public class TestIOSDriver {
	
	@Test
	public void TestSafariOnIOS() throws IOException, InterruptedException {
	
		
		DesiredCapabilities capabilities = new DesiredCapabilities();
		capabilities.setCapability("platformVersion", "12.4");
		capabilities.setCapability("browserName", "Safari");
		capabilities.setCapability("deviceName", "iPhone 8");
		capabilities.setCapability("platformName", "IOS");
		capabilities.setCapability("udid", "FFFFB0BD-B7A2-4DDC-8456-C92201FF32B7");
		capabilities.setCapability("automationName", "XCUITest");
		capabilities.setCapability ("platformName", "iOS");
		capabilities.setCapability("xcodeOrgId", "85299US2MH");
        capabilities.setCapability("xcodeSigningId", "iPhone Developer");
        capabilities.setCapability("webkitResponseTimeout", "90000");
		URL url = new URL("http://0.0.0.0:4723/wd/hub");
		IOSDriver driver = new IOSDriver(url, capabilities);
		driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
		driver.get("http://google.com");
	}

}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the NoSuchMethodError at io.appium.java_client.remote.AppiumCommandExecutor.java:93 and the Java reproducer in TestIOSDriver.java. Reproduce the iOS 12.4 simulator connection and verify that the dependency combination no longer raises this error when constructing IOSDriver.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
mobile, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.