java-client icon indicating copy to clipboard operation
java-client copied to clipboard

Unable to start Appium session when I am having sikulixapi: 2.0.5 added in the dependency.

Open JYOTIPRAKASH225 opened this issue 1 year ago • 6 comments

Description

Unable to start Appium session when I am having sikulixapi: 2.0.5 added in the dependency.

Environment

  • Java client build version or git revision if you use some snapshot: 8.5.1
  • Appium server version or git revision if you use some snapshot: 2.1.3
  • Desktop OS/version used to run Appium if necessary: Mac OS Ventura
  • Node.js version (unless using Appium.app|exe) or Appium CLI or Appium.app|exe: 20.6.0
  • Mobile platform/version under test: iOS
  • Real device or emulator/simulator: Real

Details

Unable to start Appium session when I am having sikulixapi: 2.0.5 added in the dependency. Note: I am able create session when I downgrade sikulixapi to 2.0.4.

This is the dependency added to pom.xml

com.sikulix sikulixapi 2.0.5

Code To Reproduce Issue [ Good To Have ]

	service = AppiumDriverLocalService.buildService(new AppiumServiceBuilder().withIPAddress("127.0.0.1")
			.usingPort(port).withAppiumJS(new File("/usr/local/lib/node_modules/appium/build/lib/main.js"))
			.withArgument(GeneralServerFlag.LOG_LEVEL, "debug")
			.withLogFile(new File(System.getProperty("user.dir") + "appium.log"))
			.withArgument(GeneralServerFlag.RELAXED_SECURITY));
	DesiredCapabilities capabilities = new DesiredCapabilities();

	capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "iOS");
	capabilities.setCapability("appium:platformVersion", "15");
	capabilities.setCapability("appium:deviceName", "jyotipraksh's iPhone");
	capabilities.setCapability("appium:automationName", "XCUITest");
	capabilities.setCapability("appium:app", "com.fiberlink.maas360.enterpriseappstore");
	capabilities.setCapability("appium:udid", "6279765bfc1744548bec50ddc00780049a3f155c");
	capabilities.setCapability("appium:includeSafariInWebviews", true);
	capabilities.setCapability("appium:newCommandTimeout", 3600);
	capabilities.setCapability("appium:connectHardwareKeyboard", true);

	System.out.println("Appium context set to application :" + appName);
	driver = new IOSDriver(service, capabilities);

Exception Stacktraces

(https://gist.github.com/JYOTIPRAKASH225/f72cdde390c92d22df812edf09538e0d)

Link To Appium Logs

[Appium] Welcome to Appium v2.1.3 [Appium] Non-default server args: [Appium] { address: [32m'127.0.0.1'[39m, port: [33m4385[39m, relaxedSecurityEnabled: [33mtrue[39m } [Appium] Attempting to load driver xcuitest... [debug] [Appium] Requiring driver at /Users/jprakash/.appium/node_modules/appium-xcuitest-driver [Appium] Appium REST http interface listener started on http://127.0.0.1:4385 [Appium] Available drivers: [Appium] - [email protected] (automationName 'XCUITest') [Appium] Available plugins: [Appium] - [email protected] [Appium] - [email protected] [Appium] - [email protected] [Appium] No plugins activated. Use the --use-plugins flag with names of plugins to activate [38;5;0m[HTTP][0m --> GET /status [38;5;0m[HTTP][0m {} [debug] [38;5;16m[AppiumDriver@132e][0m Calling AppiumDriver.getStatus() with args: [] [debug] [38;5;16m[AppiumDriver@132e][0m Responding to client with driver.getStatus() result: {"ready":true,"message":"The server is ready to accept new connections","build":{"version":"2.1.3"}} [38;5;0m[HTTP][0m <-- GET /status 200 9 ms - 110 [38;5;0m[HTTP][0m org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure. Host info: host: 'jprakashs-MacBook-Pro-2098.local', ip: '2402:e280:217b:ac5:b98e:5649:bd6c:fb24%en0' at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:620) at io.appium.java_client.AppiumDriver.startSession(AppiumDriver.java:274) at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:163) at io.appium.java_client.AppiumDriver.(AppiumDriver.java:89) at io.appium.java_client.AppiumDriver.(AppiumDriver.java:112) at io.appium.java_client.ios.IOSDriver.(IOSDriver.java:126) at com.appium.appium2Session.getDriver(appium2Session.java:61) at com.appium.appium2Session.main(appium2Session.java:30) Caused by: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException Build info: version: '4.12.1', revision: '8e34639b11' System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '13.4.1', java.version: '17.0.8' Driver info: driver.version: IOSDriver at io.appium.java_client.remote.AppiumProtocolHandshake.createSession(AppiumProtocolHandshake.java:137) at io.appium.java_client.remote.AppiumProtocolHandshake.createSession(AppiumProtocolHandshake.java:102) at io.appium.java_client.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:182) at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:250) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:602) ... 7 more Caused by: java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at io.appium.java_client.remote.AppiumProtocolHandshake.createSession(AppiumProtocolHandshake.java:133) ... 11 more Caused by: java.lang.NoClassDefFoundError: io/netty/handler/codec/DefaultHeaders$ValueValidator at org.asynchttpclient.RequestBuilderBase.(RequestBuilderBase.java:98) at org.asynchttpclient.RequestBuilderBase.(RequestBuilderBase.java:92) at org.asynchttpclient.RequestBuilder.(RequestBuilder.java:35) at org.asynchttpclient.RequestBuilder.(RequestBuilder.java:31) at org.asynchttpclient.Dsl.request(Dsl.java:73) at org.openqa.selenium.remote.http.netty.NettyMessages.toNettyRequest(NettyMessages.java:57) at org.openqa.selenium.remote.http.netty.NettyHttpHandler.makeCall(NettyHttpHandler.java:55) at io.appium.java_client.AppiumUserAgentFilter.lambda$apply$0(AppiumUserAgentFilter.java:88) at org.openqa.selenium.remote.http.Filter.lambda$andFinally$1(Filter.java:55) at org.openqa.selenium.remote.http.netty.NettyHttpHandler.execute(NettyHttpHandler.java:48) at org.openqa.selenium.remote.http.netty.NettyClient.execute(NettyClient.java:96) at io.appium.java_client.remote.AppiumCommandExecutor.lambda$null$0(AppiumCommandExecutor.java:187) at org.openqa.selenium.remote.http.Filter.lambda$andFinally$1(Filter.java:55) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:115) ... 16 more Caused by: java.lang.ClassNotFoundException: io.netty.handler.codec.DefaultHeaders$ValueValidator at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520) ... 30 more Exception : Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure. Host info: host: 'jprakashs-MacBook-Pro-2098.local', ip: '2402:e280:217b:ac5:b98e:5649:bd6c:fb24%en0'

JYOTIPRAKASH225 avatar Sep 22 '23 15:09 JYOTIPRAKASH225

@JYOTIPRAKASH225 try the following code, Add base Path to the builder argument

new AppiumServiceBuilder() .usingAnyFreePort() .withArgument(GeneralServerFlag.BASEPATH, "/wd/hub") .build() .start();

ashwithpoojary98 avatar Sep 23 '23 06:09 ashwithpoojary98

@ashwithpoojary98 : .withArgument(GeneralServerFlag.BASEPATH, "/wd/hub") adding this will fail. I am using Appium 2.0 There is some issue with sikulixapi: 2.0.5 When I downgrade to 2.0.4, everything works fine.

JYOTIPRAKASH225 avatar Sep 23 '23 17:09 JYOTIPRAKASH225

@JYOTIPRAKASH225 What is the JDK version that you are using? if below 11 update it!!

ashwithpoojary98 avatar Sep 24 '23 03:09 ashwithpoojary98

I am using JDK 17

JYOTIPRAKASH225 avatar Sep 25 '23 04:09 JYOTIPRAKASH225

@jlipps : Can you please suggest here? There is a lot of dependency for sikulixapi in my project. When I downgrade to 2.0.4 from 2.0.5, everything works fine. Please look into it and suggest.

JYOTIPRAKASH225 avatar Sep 25 '23 05:09 JYOTIPRAKASH225

@JYOTIPRAKASH225 The common dependencies might be mismatched, so try removing the common dependency from SikuliXAPI.

ashwithpoojary98 avatar Sep 25 '23 12:09 ashwithpoojary98