How can I run FEST Swing tests in Jenkins? - java

I'm trying to run FEST Swing tests on Jenkins as a service on Windows 7.
I have already allowed the service to interect with the desktop with the necessary permission to do so. It was no use, though.
Most of what I found on the internet either shows how to do it on Linux (through the CLI shell) or how to run it on the prompt, which is not what I'm looking for.
I have also found some vague discussions on how to run the tests letting the desktop available (which was by running it on a VM). But that's not what I need either.
I need to run the GUI tests just as they are run on Eclipse, with the graphical appearance on the desktop. When I try to do it, the following happens:
execguitest:
[echo] ----------------------------------------------
[echo] project-name: Executing project's GUI tests
[echo] ----------------------------------------------
[junit] Running dev.AllGUITests
[junit] null
[junit] null
[junit] null
[junit] Tests run:33, Failures: 3, Errors: 30, Skipped: 0, Time elapsed: 112,375 sec
[junit Test dev.AllGUITests FAILED
Does anyone have a clue on how can it be done?
P.S.: Sorry for any english mistakes. English is not my mother language.

The Documentation of FEST shows you how to configure Hudson (almost the same as Jenkins) unter Windows and how to run the tests on virtual Xvfb devices (Linux) for execution without real display devices.

I did it with the Jenkins-XVNC-Plugin.
Look at this.

Related

JPIBootLoader is not a valid Win32 application

I am new to WebSphere Application Server.Getting this error in WAS Console while executing junit class (RunAs--> JUnit Test)
Running as Junit Test in Rational Application Developer
Actual Error Message is:
JVMJ9TI001E Agent library D:\Program Files\IBM\SDPShared\plugins\org.eclipse.tptp.platform.jvmti.runtime_4.7.0.v201110280852\agent_files\win_em64t\JPIBootLoader could not be opened (D:\Program Files\IBM\SDPShared\plugins\org.eclipse.tptp.platform.jvmti.runtime_4.7.0.v201110280852\agent_files\win_em64t\JPIBootLoader is not a valid Win32 application. )
JVMJ9VM015W Initialization error for library j9jvmti24(-3): JVMJ9VM009E J9VMDllMain failed .
Came Across this below links and tried but can't able to resolve"
link1-IBM
link2-IBM
I am using windows 10 64 bit, RAD 8.0.4 , WAS 7.0.23 ,Junit 4.12.
Help me to resolve this issue. Thanks in Advance.
Is the Junit running within the IDE's JVM? To check click on Run > Run Configurations, and look for the unit test you are trying to run. Then click on the JRE tab. It should show the Project Execution Environment.
Also, you're on a considerably old version of RAD and WAS. Any reason you can't upgrade?

The JUnit test suite failes with [junit] ASSERTION FAILED: 'ci->bp_id == 0'

I have a JUnit test suite running on Jenkins.
The test suite uses the below technologies.
Ant to build
JMockint to Mock the EJBs
Jacoco for Code coverage
The test suite runs one a Jenkins Slave machine (unix), and runs for an average time of 45 mins (~1500 tests).
The test count in the suite gradually getting increased. Form recently I get the below error making the test run crash intermittently.
[junit]
[junit] ASSERTION FAILED: 'ci->bp_id == 0'
[junit] In cmReleaseCodeInfo() (src/jvm/runtime/code/memory/codecollector.c:454)
[junit] Assertion failed after 0 days, 00:32:50 on Mon Jan 23 11:14:50 2017
[junit] Running requires.testMis.MaskedCinTest
[junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
[junit] Tests FAILED (crashed)
I'm not sure how to trace this. Would be glad if anyone has a clue/ or a lead to find whats going on.
Would be more interested to see from where [junit] ASSERTION FAILED: 'ci->bp_id == 0' is coming.
Would be more interested to see from where [junit] ASSERTION FAILED: 'ci->bp_id == 0' is coming.
I could not find this file. In fact I have a java project. The file showing above is C. This looks much more like lower level than Java. – Asanke 8 hours ago
Also the assertion shown above, I have not coded such in my project. – Asanke 8 hours ago
The assertion is compiled into a binary executable your code uses.
There are different approaches obout how to deal with this situation depending on what type of test you are executing.
If this is a regression test (or acceptance test) you may have discovered a bug: your code passes an invalid bp_id (what ever this is, you should know...).
If this is a UnitTest then you should mock the code that calls the binary executable.

Evosuite: failure in executing test cases

I follow the evosuite maven documentation to generate unit test cases for my project. Below is the command I've used:
mvn -DmemoryInMB=2000 -Dcores=2 evosuite:generate evosuite:export test
The tool takes around 1 hour to generate test cases for my project (with 9700 lines of Java code). However when it proceed to mvn test phase, all test cases failed with the same message:
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0 sec <<< FAILURE! - in com.xxx.yyy.util.Messages_ESTest
com.xxx.yyy.util.Messages_ESTest Time elapsed: 0 sec <<< ERROR!
java.lang.IllegalStateException: Trying to set up the sandbox while executing a test case
at <evosuite>.<evosuite>(<evosuite>)
at <evosuite>.<evosuite>(<evosuite>)
at <evosuite>.<evosuite>(<evosuite>)
While running the generated test case in Intellij IDEA most of them can pass the test:
Any one got any idea?
this is clearly a bug, which would be best to report on
https://github.com/EvoSuite/evosuite/issues
furthermore, currently in 1.0.3 the tests generated by EvoSuite do not work well with "mvn test". The fix is already in the SNAPSHOT though, and will be part of next release. However, the "Trying to set up the sandbox" might be a new bug as I haven't seen it before... :(

Maven -Dtest=* test, does not seem to run all tests

I've got a Jenkins CI server that is set up with a Selenium test project running with maven-surefire. I need the project to be a parameterized build, so that I can trigger the build via URL with a Dtest as a parameter (and only run the tests I specify in the url). This works great.
Unfortunately, I've been unable to figure out how to run ALL of the tests, while in this parameterized configuration. Since it is in parameterized build mode, I must ALWAYS specify the -Dtest parameter.
Based on the Surefire documentation, it seems like I should be able to wildcard the test names, and everything will be run:
-Dtest=* or -Dtest=Test*
The odd result of running these parameters is a print statement (that I created) from all 6 of the tests (denoting that they were all started):
"Test <test_name> started, click here to see the SauceLabs video"
And then the standard test result (below) for only 4/6 tests
Running <test_class_path>
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.048 sec
Followed by the summary:
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0
If it matters, the tests are being run in parallel using surefire, and one other odd thing is that while printing out the individual test results, after the 4th one, the 5th result starts printing, but never shows a result, and includes a $1 at the end:
Running <test_class_path>$1
Please let me know if I can clarify anything or answer any questions.
Thanks in advance for any help!
I think that it's a regular expession:
mvn -Dtest=.*
works for me.

Error appears before running the Webdriver test on a Hudson slave

We are trying to migrate our system to WebDriver from Selenium 1.
Thorough the Hudson slave an error message appeared, but the test run fine in eclipse.
Environments:
Hudson master: Linux machine
Hudson slave: windows 7, x86
Java version: 1.7.0_03
System:
A new Hudson job was set up for the task, with the same configurations as it was for Selenium 1 test suites. The job executes a target from the build.xml file. clean,makedir and compile targets were ran successfully.
On executing the tests the following error message appeared on Hudson Console:
run_shopping_travel_tests:
[junit] Running com.example.tests.ExampleTests
[junit] Tests run: 1, Failures: 0, Errors: 2, Time elapsed: 2.385 sec
[junit] Test com.example.tests.ExampleTests FAILED
[junit] Running com.example.tests.Example2Test
[junit] Tests run: 1, Failures: 0, Errors: 2, Time elapsed: 0.752 sec
[junit] Test com.example.tests.Example2Test FAILED
[echo] selenium directory: C:\Selenium
The error:
Error Message
LINUX
Stacktrace
java.lang.NoSuchFieldError: LINUX
at org.openqa.selenium.firefox.FirefoxBinary.isOnLinux(FirefoxBinary.java:62)
at org.openqa.selenium.firefox.FirefoxBinary.startProfile(FirefoxBinary.java:72)
at org.openqa.selenium.firefox.FirefoxBinary.clean(FirefoxBinary.java:273)
at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:78)
at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:142)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:85)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:121)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:77)
at com.example.tests.ExampleTests.setup(ExampleTests.java:43)
The java code for the test:
public class ExampleTests
{
FirefoxDriver driver = null;
#Before
public void setup() {
File profileDir = new File( "C:\\Selenium\\FirefoxProfile" );
FirefoxProfile profile = new FirefoxProfile(profileDir);
driver = new FirefoxDriver(profile); // line 43, where error appears
}
#Test
public void T100_VerifyExampleTest() {
// some test code here
}
}
We have tried to run the test without "profile" and the same error message appeared.
Thanks in advance.
Problem solved.
There were some jar libraries included which were used for compiling by -javac (in the ant script), but not by eclipse.
Solution:
Check the jar files one-by-one,and delete the unnecessary ones from the lib folder.

Categories