Jenkins Build failing after integration with Selenium tests - java

Am trying to integrate our Testng Selenium tests into the Jenkins build queue using Build Gradle Test, currently failing with unreachable exception error. Its a freestyle build, with Invoke Gradle Script as the build step. Please find the console output in the below:
Build Gradle file:
**
Build Failure Logs:
**
[Gradle] - Launching build.
[QaAutomationWeb] $ /var/jenkins_home/tools/hudson.plugins.gradle.GradleInstallation/Gradle_6.5.1/bin/gradle test
Starting a Gradle Daemon, 1 busy Daemon could not be reused, use --status for details
Task :compileJava UP-TO-DATE
Task :processResources NO-SOURCE
Task :classes UP-TO-DATE
Task :compileTestJava
Task :processTestResources UP-TO-DATE
Task :testClasses
Task :test
FBMS-Modernization Tests > Regression Tests > com.fbms.test.LoginTest > getDriver FAILED
org.openqa.selenium.remote.UnreachableBrowserException at RemoteWebDriver.java:589
Caused by: org.openqa.selenium.WebDriverException at DriverService.java:165
Caused by: org.openqa.selenium.net.UrlChecker$TimeoutException at UrlChecker.java:104
Caused by: com.google.common.util.concurrent.UncheckedTimeoutException at SimpleTimeLimiter.java:143
Caused by: java.util.concurrent.TimeoutException at FutureTask.java:205
5 tests completed, 1 failed, 4 skipped
Task :test FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':test'.
There were failing tests. See the report at: file:///var/jenkins_home/workspace/QaAutomationWeb/build/reports/tests/test/index.html
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 38s
4 actionable tasks: 2 executed, 2 up-to-date
Build step 'Invoke Gradle script' changed build result to FAILURE
Build step 'Invoke Gradle script' marked build as failure
Finished: FAILURE

Related

How to create and integrate getDatabyID in junit

I have code like this
#Test
void showDataById() throws Exception {
Optional<ProductParameterTable> data = service.getByUuid(this.ppr.getProductParameterTableId());
ProductParameterTable pp = new ProductParameterTable();
pp.setProductParameterTableId(data.get().getProductParameterTableId());
when(service.getByUuid(any(String.class))).thenReturn(data);
mockMvc.perform(get("/product/{uuid}", pp.getProductParameterTableId())
.contentType(MediaType.APPLICATION_JSON))
.andExpect(status().isOk())
.andExpect(jsonPath("$..product_parameter_table_id").value(pp.getProductParameterTableId()));
verify(service, VerificationModeFactory.times(1)).getByUuid(Mockito.any());
reset(service);
}
but when I check in my intellij this code not coverage my controller. before I create this code I have code for insert. that code for insert is coverage. but for this code not coverage. I use gradle 6.7
Task :compileJava UP-TO-DATE
Task :processResources UP-TO-DATE
Task :classes UP-TO-DATE
Task :compileTestJava
Task :processTestResources NO-SOURCE
Task :testClasses
Task :test FAILED
Task :jacocoTestReport SKIPPED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':test'.
No tests found for given includes: jii..controller.product.ProductParameterTableControllerTest
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.7.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 1s
4 actionable tasks: 2 executed, 2 up-to-date
so how to fix my problem for this code ?

Gradle with TestNg: No tests found

I am using gradle project
Project is working fine with junit, but
with TestNg i am getting build fail error with this
Testing started at 9:18 PM ...
9:18:08 PM: Executing tasks ':cleanTest :test --tests "abc.lau" --scan'...
> Task :cleanTest
> Task :compileJava NO-SOURCE
> Task :processResources NO-SOURCE
> Task :classes UP-TO-DATE
> Task :compileTestJava
> Task :processTestResources NO-SOURCE
> Task :testClasses
> Task :test FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':test'.
> No tests found for given includes: [abc.lau](filter.includeTestsMatching)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 0s
3 actionable tasks: 3 executed
did you explicitly specify in build.gradle that you use testng?
test {
useTestNG()
}

"bootRun" task in Gradle - FAILURE: Build failed with an exeption

I am follwoing this tutorial
https://auth0.com/blog/integrating-spring-data-jpa-postgresql-liquibase/
at the moment.
But I have some problems with Gradle... Everytime when I try to run the project with "./gradlew bootRun" it returns an error:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':bootRun'.
> Process 'command 'C:\Program Files\Java\jdk-10.0.2\bin\java.exe'' finished wit
h non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 1m 44s
4 actionable tasks: 2 executed, 2 up-to-date
I'm running Java 10.0.2 and Gradle 4.10.1.
I appreciate any kind of help!

Can't run my project error in "run" debug file included

am using last version of gluonhq also i try some other versions . my problem is when i try to run the project , if someone know the solve of it note that am using the demo version i got the following msg:
Executing external task 'run'...
:compileJava
:processResources
:classes
:compileDesktopJava UP-TO-DATE
:processDesktopResources UP-TO-DATE
:desktopClasses UP-TO-DATE
:run FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':run'.
Process 'command 'C:\Program Files\Java\jdk1.8.0_121\bin\java.exe'' finished with non-zero exit value -1073740791
The Debug log here

Appium :cucumber FAILED (DuplicateStepDefinitionException)

Previously I was working with calabash and recently jumped on to Appium. I need some help on Appium-CI-Bamboo issue. The Automation scripts were written in Java-Junit using gradle in cucumber format. It's working fine locally but fails on Bamboo server with below error. I have tried installing all the gems on server(MAC) which were available on my local machine(MAC) but couldn't find where the issue is. Did anyone faced this issue and able to solve it, if so could you help me with the solution which could be a great favour please?
Starting a Gradle Daemon (subsequent builds will be faster)
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
:clean UP-TO-DATE
BUILD SUCCESSFUL
Total time: 20.098 secs
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:jar
:assemble
:compileTestJava
:processTestResources
:testClasses
:test
:check
:build
:runTags UP-TO-DATE
:generateReport UP-TO-DATE
Exception in thread "main" cucumber.runtime.DuplicateStepDefinitionException: Duplicate step definitions in com.project.qa.steps.HomeSteps.tap_on_favourites_icon() in file:/Users/admin/bamboo/xml-data/build-dir/PIR-IQDU-JOB1/UITest/build/classes/test/ and com.project.qa.steps.HomeSteps.tap_on_favourites_icon() in file:/Users/admin/bamboo/xml-data/build-dir/PIR-IQDU-JOB1/UITest/build/classes/test/
        at cucumber.runtime.RuntimeGlue.addStepDefinition(RuntimeGlue.java:33)
        at cucumber.runtime.java.JavaBackend.addStepDefinition(JavaBackend.java:151)
        at cucumber.runtime.java.MethodScanner.scan(MethodScanner.java:68)
        at cucumber.runtime.java.MethodScanner.scan(MethodScanner.java:41)
        at cucumber.runtime.java.JavaBackend.loadGlue(JavaBackend.java:86)
        at cucumber.runtime.Runtime.<init>(Runtime.java:92)
        at cucumber.runtime.Runtime.<init>(Runtime.java:70)
        at cucumber.runtime.Runtime.<init>(Runtime.java:66)
        at cucumber.api.cli.Main.run(Main.java:35)
        at cucumber.api.cli.Main.main(Main.java:18)
:cucumber FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':cucumber'.
> Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 27.164 secs
Many Thanks in Advance

Categories

Resources