NoClassDefFoundError: org/apache/xmlrpc/client/XmlRpcClientConfig in selenium testlink integration - selenium

I am trying to integrate testcases in testlink with selenium but getting below error during execution,
java.lang.NoClassDefFoundError: org/apache/xmlrpc/client/XmlRpcClientConfig
at com.bizom.web.Listeners.TestLinkManager.<init>(TestLinkManager.java:16)
at com.bizom.web.Listeners.TestLinkManager.<clinit>(TestLinkManager.java:13)
at com.bizom.web.Listeners.Listeners.<clinit>(Listeners.java:24)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:64)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
Added maven Dependency,
<dependency>
<groupId>com.github.kalokanand</groupId>
<artifactId>testlink-api-client</artifactId>
<version>2.0</version>
</dependency>
Below is the code snippet ,
testLink = new TestLinkAPIClient(configFile.getProperty("TESTLINK_KEY"),configFile.getProperty("TESTLINK_URL"));

Related

Jenkins maven build test failure for Sikuli dependency with Selenium

I have created Maven project in eclipse with Selenium & TestNG to create automation test scripts which I want to execute from Jenkins.
I am getting below error while building it.
Failed to collect dependencies at com.sikulix:sikulixapi:jar:1.1.0 -> jxgrabkey:jxgrabkey:jar:1.0: Failed to read artifact descriptor for jxgrabkey:jxgrabkey:jar:1.0: Could not transfer artifact jxgrabkey:jxgrabkey:pom:1.0 from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories: [uni-due.de (http://mvn.is.inf.uni-due.de:8081/nexus/content/repositories/atunes-dependencies/, default, releases)]
I have given this test -Dbrowser="Chrome" in goals and options
Please do the helpful.
I'm using this dependency:
<dependency>
<groupId>com.sikulix</groupId
<artifactId>sikulixapi</artifactId>
<version>1.1.0</version>
</dependency>
You can try with the latest Maven Sikuli dependency:
<!-- https://mvnrepository.com/artifact/org.sikuli/sikuli-api -->
<dependency>
<groupId>org.sikuli</groupId>
<artifactId>sikuli-api</artifactId>
<version>1.2.0</version>
</dependency>

Unable to run a simple cucumber feature file in intelliJ

I've just installed the community edition of IntelliJ and the Cucumber integration. When I try to run a feature, I get the error below. How do I fix this? I have cucumber-core 4.7.2 and gherkin 7.0.4.
Feature: OrangeHRM Login
Scenario: Logo presence on OrangeHRM home page
Given I launch chrome browser
When I open orangeHRM homepage
Then I verify that the logo present on page
And close the browser
Error :
WARNING: You are using deprecated Main class. Please use io.cucumber.core.cli.Main
Exception in thread "main" java.lang.NoClassDefFoundError: gherkin/IGherkinDialectProvider
at io.cucumber.core.options.CommandlineOptionsParser.parse(CommandlineOptionsParser.java:24)
at io.cucumber.core.options.CommandlineOptionsParser.parse(CommandlineOptionsParser.java:29)
at io.cucumber.core.cli.Main.run(Main.java:29)
at cucumber.api.cli.Main.run(Main.java:28)
at cucumber.api.cli.Main.main(Main.java:15)
Caused by: java.lang.ClassNotFoundException: gherkin.IGherkinDialectProvider
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)
... 5 more
Process finished with exit code 1
As stated by #mpkorstanje, you are using the wrong version of Gherkin with this version of Cucumber.
You don't need to add a Gherkin dependency yourself; this can be managed by your build tool (Maven/Gradle).
As stated in the docs, you only need the cucumber-java or cucumber-java8 dependency. Which one you need, depends on whether you want to write annotated methods or lambdas, respectively:
If you are going to use the lambda expressions API (Java 8) to write the step definitions, add the following dependency to your pom.xml:
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java8</artifactId>
<version>4.7.1</version>
<scope>test</scope>
</dependency>
Otherwise, to write them using annotated methods, add the following dependency to your pom.xml:
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>4.7.1</version>
<scope>test</scope>
</dependency>

Getting java.lang.NoClassDefFoundError: org/openqa/selenium/Rectangle error

I am trying to run a piece of selenium code in my local instance and running into this error. Please help me figure out this issue as I couldn't find anything over any of the blogs
java.lang.NoClassDefFoundError: org/openqa/selenium/Rectangle
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetPublicMethods(Class.java:2902)
at java.lang.Class.getMethods(Class.java:1615)
at sun.misc.ProxyGenerator.generateClassFile(ProxyGenerator.java:451)
at sun.misc.ProxyGenerator.generateProxyClass(ProxyGenerator.java:339)
at java.lang.reflect.Proxy$ProxyClassFactory.apply(Proxy.java:639)
at java.lang.reflect.Proxy$ProxyClassFactory.apply(Proxy.java:557)
at java.lang.reflect.WeakCache$Factory.get(WeakCache.java:230)
at java.lang.reflect.WeakCache.get(WeakCache.java:127)
at java.lang.reflect.Proxy.getProxyClass0(Proxy.java:419)
at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:719)
at
I think you are missing this dependency in pom.xml:
The following code worked for me
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.53.1</version>
</dependency>

Selenium remote driver issue with HtmlUnit driver

[i'm seeing the issue with Selenium remote driver when I'm executing the script with Htmlunit driver.
Note 1:- Same script works without any issue when I'm running with Firefox driver.]
Note 2: My browser had security authentication process for whatever the site i open, Not sure if that have ant role in this.
I have observed the selenium remote driver under maven shows with little different icon in left pane.
I feel its jar file loading issue.
I tried to put the selenium remote driver manually into .m2 repository.
1
Error message:-
Exception in thread "main" java.lang.NoClassDefFoundError: org/openqa/selenium/remote/SessionNotFoundException
at TestPackage.titleNUrlCheckingTest.main(titleNUrlCheckingTest.java:16)
Caused by: java.lang.ClassNotFoundException: org.openqa.selenium.remote.SessionNotFoundException
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 1 more
[enter image description here][2]
You need to use latest version, note the change of artifactId from old versions.
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>htmlunit-driver</artifactId>
<version>2.26</version>
</dependency>
which depends on
selenium-api 3.3.1
Update:
Your pom.xml works with simple test case of HtmlUnitDriver, but there is a potential conflict of versions, you should exclude HtmlUnitDriver 2.24 from selenium-java 3.3.1:
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.3.1</version>
<exclusions>
<exclusion>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>htmlunit-driver</artifactId>
</exclusion>
</exclusions>
</dependency>
Also, try to remove all selenium dependencies, and have only htmlunit-driver, all needed dependencies are automatically handled by maven.
Please update your POM XML file with latest version of htmlunit dependency
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>htmlunit-driver</artifactId>
<version>2.32.1</version>
</dependency>
and remove if you have something like
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-htmlunit-driver</artifactId>
<version>2.52.0</version>
</dependency>
and update project. This should resolve your exception issue.
Reference: https://github.com/SeleniumHQ/selenium/issues/4930

Mule Twitter Maven Dependency - java.lang.ClassNotFoundException: org.mule.security.oauth.config.AbstractDevkitBasedDefinitionParser

I am trying to use the Mule Twitter connector as a Maven dependency like follows:
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-twitter</artifactId>
<version>3.0.1</version>
</dependency>
But when I use "Run as Mule with Maven" or run a test from Maven I get the following error:
java.lang.ClassNotFoundException: org.mule.security.oauth.config.AbstractDevkitBasedDefinitionParser