Error while running Maven tests via Jenkins

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Error while running Maven tests via Jenkins

Adrien007
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
Earlier I used to use JRE instead of JDK but I was getting errors and I read through this post so changed it from JRE to JDK

I have installed MAVEN 3.05 in "jenkins/configure" as you showed in 8th selenium video
Reply | Threaded
Open this post in threaded view
|

Re: Error while running Maven tests via Jenkins

softwaretestingforum
Administrator
You need jdk if you want to develop java application, JRE is used to run them.
What errors did you encounter when you had JDK set? I would suggest you to set it back to JDK and not JRE
~ seleniumtests.com
Reply | Threaded
Open this post in threaded view
|

Re: Error while running Maven tests via Jenkins

Adrien007
I am sorry, I meant to say that I had JRE but changed to JDK. So now when I have JDK in environment variables and same pom.xml is successfully running as Maven test (M2 test using eclipse) why it is not running via Jenkins, why it is saying "Perhaps you are using JRE" , why it couldn't find the compiler??. Is it somewhere else that also need to put JDK path, may be in JENKINS?
As of now I have tried to install JDK in "jenkins/configure" the way I installed Maven 3.05. I dont know it would solve the problem...
Reply | Threaded
Open this post in threaded view
|

Re: Error while running Maven tests via Jenkins

softwaretestingforum
Administrator
Yup, seems that maven is not configured to use JDK.
This post seems to throw more light on this. It might help -

http://stackoverflow.com/a/2222880
~ seleniumtests.com
Reply | Threaded
Open this post in threaded view
|

Re: Error while running Maven tests via Jenkins

Adrien007
Yes this post helped.
1. I added a plugin which gives javac.exe path Result : Error : javac: target release 1.5 conflicts with default source release 1.7
2. So I google the error and found that I have to downgrade java from latest to 1.6 and now test cases are running via Jenkins.
But now the problem is test cases are running headless(which is nice in one context), Jenkins didn't launch the browser??
Have I missed something ??
Reply | Threaded
Open this post in threaded view
|

Re: Error while running Maven tests via Jenkins

softwaretestingforum
Administrator
Tests can not run headless until unless you configure them to be run in headless mode :)
Have a look at your test configuration, I am sure we are missing something.
Or post your driver initialization script here and I would check that.
~ seleniumtests.com
Reply | Threaded
Open this post in threaded view
|

Re: Error while running Maven tests via Jenkins

Adrien007
In pom.xml I have asked to run testng.xml. This xml run class which initiates tear down method with @BeforeMethod annotation, here I initialised it as :
WebDriver driver = new FirefoxDriver();
driver.get(appUrl);
I couldn't found out anything wrong though I am still looking.
I dont think there could be case which passes (invokes browser) when I run testng.xml as testng suite with the help of eclipse but not when running via Jenkins
Second thing installing a testng is not a great help as its not delivering those smart reports as you showed in the video, no good looking chart/graph
This is how it is displaying :
No good looking graphs/charts
Reply | Threaded
Open this post in threaded view
|

Re: Error while running Maven tests via Jenkins

softwaretestingforum
Administrator
Following setup should indeed launch browser -

WebDriver driver = new FirefoxDriver();
driver.get(appUrl);

I really don't see any reason why tests should go headless.

About TestNG graph, look at the message in your snapshot -

<Need at least 2 build....> 

Hope it makes it clear, why graph are not available now.
~ seleniumtests.com
Reply | Threaded
Open this post in threaded view
|

Re: Error while running Maven tests via Jenkins

Adrien007
Graphs are there, but it is still running headless.
When I ask it to launch chrome it runs headless but when I asked it to run in FF it stuck on loader (spin wheel) forever and don't run any test.