Running Cucumber through ANT | Selenium Forum
M
Posted on 29/10/2015
Hello frnds,

I have configured ANT in order to run Cucumber with ANT.
While compiling the ant i am getting following errors. What could be the possible solution for this.
Thanks in advance :)

[i:2fc4vy7v]D:\Selenium\Softwares\Java_Projects\Mod_Cucumber>ant compile
Buildfile: D:\Selenium\Softwares\Java_Projects\Mod_Cucumber\build.xml

clean:
[delete] Deleting directory D:\Selenium\Softwares\Java_Projects\Mod_Cucumber\build

compile:
[mkdir] Created dir: D:\Selenium\Softwares\Java_Projects\Mod_Cucumber\build
[javac] Compiling 2 source files to D:\Selenium\Softwares\Java_Projects\Mod_Cucumber\build
[javac] D:\Selenium\Softwares\Java_Projects\Mod_Cucumber\src\runnerClassCucumber.java:3: error: package org.junit.runner does not exist
[javac] import org.junit.runner.*;
[javac] ^
[javac] D:\Selenium\Softwares\Java_Projects\Mod_Cucumber\src\runnerClassCucumber.java:10: error: cannot find symbol
[javac] @RunWith(Cucumber.class)
[javac] ^
[javac] symbol: class RunWith
[javac] 2 errors

BUILD FAILED
D:\Selenium\Softwares\Java_Projects\Mod_Cucumber\build.xml:66:
Compile failed; see the compiler error output for details.

Total time: 0 seconds
[/i:2fc4vy7v]

M
Replied on 30/10/2015

add the latest cucumber jar to your jars folder.


M
Replied on 30/10/2015

I am using these JAR versions, Please have a look if i am using the right versions.
I have attached the screenshot of JARs.

Responsive image

M
Replied on 30/10/2015

Thanks Ashish for the solution
You were right, i was missing 1 jar file which helped me solve 1 error
for the other error i.e. "cannot find symbol" I was missing the desired import.
but after resolving above 2, i got some irrelevant error, although after placing that file i got my build successful, but i am confused why that error came, error was:
Could not find file D:\Selenium\Softwares\Java_Projects\Mod_Cucumber\src\log4j.properties to copy.
I have not used this log4j in my current project, anyways after placing this file i could run the build successfully.


M
Replied on 30/10/2015

[quote:2b600ruf]Could not find file D:\Selenium\Softwares\Java_Projects\Mod_Cucumber\src\log4j.properties to copy.
I have not used this log4j in my current project, anyways after placing this file i could run the build successfully.
[/quote:2b600ruf]

you must have used log4j somewhere. delete the log4j jar files from your project and you will find be able to find where the log4j is used.