Does anybody have an experience to build an Apache Ant automation from SeleniumHQ jar files?

14 views
Skip to first unread message

Artur Khachatryan

unread,
May 3, 2018, 10:38:00 PM5/3/18
to Selenium Users

I was trying to run an Ant automation based on JAR files from SeleniumHQ and getting the following errors. ( AlertsTest.class is in the jar file I am pointing in build.xml file, so it is now clear why this error is popping up. )



..

I get the following error while run ant test:

test:
[junit] Running org.openqa.selenium.chrome.ChromeDriverTests
[junit] Testsuite: org.openqa.selenium.chrome.ChromeDriverTests
[junit] Exception in thread "main" java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file org/openqa/selenium/AlertsTest
[junit] at java.lang.ClassLoader.defineClass1(Native Method)
[junit] at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
[junit] at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
[junit] at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
[junit] at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
[junit] at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
[junit] at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
[junit] at java.security.AccessController.doPrivileged(Native Method)
[junit] at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
[junit] at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
[junit] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:336)
[junit] at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
[junit] at java.lang.Class.forName0(Native Method)
[junit] at java.lang.Class.forName(Class.java:349)
[junit] at sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:114)
[junit] at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:125)
[junit] at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49)
[junit] at sun.reflect.annotation.AnnotationParser.parseSig(AnnotationParser.java:439)
[junit] at sun.reflect.annotation.AnnotationParser.parseClassValue(AnnotationParser.java:420)
[junit] at sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:725)
[junit] at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:531)
[junit] at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:355)
[junit] at sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:286)
[junit] at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:120)
[junit] at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:72)
[junit] at java.lang.Class.createAnnotationData(Class.java:3523)
[junit] at java.lang.Class.annotationData(Class.java:3512)
[junit] at java.lang.Class.getAnnotations(Class.java:3448)
[junit] at org.junit.runner.Description.createSuiteDescription(Description.java:124)
[junit] at org.junit.internal.runners.ErrorReportingRunner.getDescription(ErrorReportingRunner.java:28)
[junit] at org.junit.runners.Suite.describeChild(Suite.java:123)
[junit] at org.junit.runners.Suite.describeChild(Suite.java:27)
[junit] at org.junit.runners.ParentRunner.getDescription(ParentRunner.java:352)
[junit] at org.junit.runner.Runner.testCount(Runner.java:41)
[junit] at junit.framework.JUnit4TestAdapter.countTestCases(JUnit4TestAdapter.java:34)
[junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:534)
[junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:1182)
[junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:1033)
[junit] Testsuite: org.openqa.selenium.chrome.ChromeDriverTests
[junit] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0 sec
[junit]
[junit] Testcase: BeforeFirstTest took 0 sec
[junit] Caused an ERROR
[junit] Forked Java VM exited abnormally. Please note the time in the report does not reflect the time until the VM exit.
[junit] junit.framework.AssertionFailedError: Forked Java VM exited abnormally. Please note the time in the report does not reflect the time until the VM exit.
[junit]
[junit] Running org.openqa.selenium.chrome.ChromeDriverTests
[junit] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0 sec

BUILD FAILED

Reply all
Reply to author
Forward
0 new messages