last day (16 days later) » 

1:32 PM
0
Q: NoClassDefFoundError: io/restassured/RestAssured

goney225I have following problem with test execute from .bat file. I execute my test from .bat file. set projectPath=D:\git\content-generator-tests cd %projectPath% set classpath=%projectPath%\target\classes;%projectPath%\lib\* java org.testng.TestNG %projectPath%\dev.xml pause I'm not sure that above ....

 
Where do you tell your main class about class path? try " java –classpath %classpath% org.testng.TestNG %projectPath%\dev.xml"
 
I try with this and another error in command line. D:\git\content-generator-tests>java ÔÇôclasspath D:\git\content-generator-tests\target\classes;D:\git\content‌​-generator-tests\lib‌​* org.testng.TestNG D:\git\content-generator-tests\dev.xml Error: Could not find or load main class ÔÇôclasspath
 
Are you using build tools like maven/gradle to add dependencies to your project? Or adding it manually in Intellij ?
 
Yes I have pom.xml with dependencies.
 
Try setting your Java classpath in the META-INF/MANIFEST.MF file by using the Class-Path attribute. Eg : Main-Class: org.testng.TestNG Class-Path: lib/*.jar
 
1:32 PM
Where is META-INF/MANIFEST.MF file?
Hello
Are you available?
 
2:17 PM
Hi
have your tried building the project using maven -

mvn clean install
once jar is created, you can directly run tht using java -jar
 
wait
 
Can you create a project similar to yours on github, say with similar project stucture and dependencies?
 
strange
'mvn' is not recognized as an internal or external command,
operable program or batch file.
 
maven is not set in your system path var.
 
I added now
maybe should I restary my machine
 
2:27 PM
mvn --version?
not required to restart
start new terminal.
 
in intellij still the same communicate mvn is not recognized
but in CMD is ok and version 3.6.3
 
np..
we can try with CMD.
 
from CMD I execute mvn clean install
build success
 
got to target folder and see if you can locate jar
 
Yes I have a new file .jar
what next with this .jar file?
 
2:37 PM
mvn clean test
does this invoke the test suite?
 
no.. I got only build success
hmm my file dev.xml contains parameters and three test classes with methods
wait, I have a problem with one dependency in pom.xml
[WARNING] Some problems were encountered while building the effective model for com.rest.assured:RestAssured:jar:1.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 13, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
in pom.xml I have this
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>7</source>
<target>7</target>
</configuration>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
</dependency>
 
3:24 PM
I don't have more ideas what happened in this case :(
I execute in dev.xml one test rest assured for GET method and I get content of endopoint with 200 status
 
if possible, clone/upload similar project setup on github. Will see if I can fix it on my local.
 
hm ok I place this project
 
You are using java version 7?
 
In project structure I have 10
project language level
 
Ok. once you have this on git, share the link, will try in my local and let you know.
 
3:36 PM
can you see files?
 
got it. Give me sometime, in middle of something, will try an fix. If any change, will push to same repo.
 
3:57 PM
ok
 
4:22 PM
and? Do you know where is the problem?
 
I have updated pom.xml..

check out latest, and run "mvn clean test" lets see,
Also check if you can try running this with JDK 8.
 
4:38 PM
I have 1.8 jdk
is this correct version?
I don't see changes in pom.xml
do you push it?
 
5:25 PM
?
 
 
2 hours later…
7:25 PM
Tests execute from command mvn clean test is working!
I change pom.xml and mvn clean test is working
but
from content-generator-tests.bat I got error and different result
classpath is wrong?
classpath in .bat file?
 

  last day (16 days later) »