appium / appium/java-client

Exception in thread "main" java.lang.NoClassDefFoundError: org/openqa/selenium/remote/AcceptedW3CCapabilityKeys at io.appium.java_client.remote.NewAppiumSessionPayload.<clinit>(NewAppiumSessionPayload.java:98)

Open
#1,108 16 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

User side problem/problem of an external tool
Dominant language
Java
Stars
1.3k
Forks
752
Avg merge
6d 21h
Merged PRs (30d)
8

Description

Description

Exception in thread "main" java.lang.NoClassDefFoundError: org/openqa/selenium/remote/AcceptedW3CCapabilityKeys
at io.appium.java_client.remote.NewAppiumSessionPayload.(NewAppiumSessionPayload.java:98)
at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:175)
at io.appium.java_client.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:217)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:239)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:543)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:207)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:130)
at io.appium.java_client.DefaultGenericMobileDriver.(DefaultGenericMobileDriver.java:38)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:84)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:94)
at io.appium.java_client.android.AndroidDriver.(AndroidDriver.java:95)
at scr.main(scr.java:40)
Caused by: java.lang.ClassNotFoundException: org.openqa.selenium.remote.AcceptedW3CCapabilityKeys
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 15 more

Environment
Appium :1.9.2 beta.2
Java client :7.0
Selenium server standalone :3.12.0
Details
Not even hitting the appium server
Throwing the below error
Exception in thread "main" java.lang.NoClassDefFoundError: org/openqa/selenium/remote/AcceptedW3CCapabilityKeys
at io.appium.java_client.remote.NewAppiumSessionPayload.(NewAppiumSessionPayload.java:98)
at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:175)
at io.appium.java_client.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:217)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:239)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:543)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:207)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:130)
at io.appium.java_client.DefaultGenericMobileDriver.(DefaultGenericMobileDriver.java:38)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:84)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:94)
at io.appium.java_client.android.AndroidDriver.(AndroidDriver.java:95)
at scr.main(scr.java:40)
Caused by: java.lang.ClassNotFoundException: org.openqa.selenium.remote.AcceptedW3CCapabilityKeys
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 15 more
Code To Reproduce Issue [ Good To Have ]
import java.net.;
import java.util.HashMap;
import org.openqa.selenium.
;
import org.openqa.selenium.remote.DesiredCapabilities;
import io.appium.java_client.*;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.ios.IOSDriver;

public class scr {

@SuppressWarnings("rawtypes")
public static AppiumDriver driver;

@SuppressWarnings("rawtypes")
public static void main(String[] args) throws MalformedURLException, InterruptedException{
	// TODO Auto-generated method stub
	DesiredCapabilities capability=new DesiredCapabilities();
	capability.setCapability("platformName","Android");
	capability.setCapability("platformVersion","8.0");
	capability.setCapability("automationName", "UIAutomator2");
	capability.setCapability("deviceName","Nexus 5X");
	capability.setCapability("noReset",true);
	capability.setCapability("bundleId","com.mcoe.UICatalog");
	capability.setCapability("appPackage","com.flipkart.android");
	capability.setCapability("appActivity","com.flipkart.android.SplashActivity");
	HashMap<String, String> customFindModules = new HashMap<>();
      customFindModules.put("ai", "test-ai-classifier");
      capability.setCapability("customFindModules", customFindModules);
      capability.setCapability("shouldUseCompactResponses", false); 
	 driver=new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"),capability);
	 driver.findElement(By.id("com.flipkart.android:id/mobileNo")).sendKeys("8870257316");
	 driver.findElement("-custom","ai:cart").click();
	 driver.quit();
}

}

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 stack trace at io.appium.java_client.remote.NewAppiumSessionPayload.java:98 and reproduce it from scr.main using Appium Java client 7.0 with Selenium server 3.12.0. Confirm the dependency mismatch causing the missing class and verify that AndroidDriver can create a session without the NoClassDefFoundError.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
mobile, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.