When I run my test through jenkins chrome browser is not triggered and also showing testng.xml file is not matching - selenium

Chrome browser is not launching when I click the build now link in jenkins, but showing build is success.
Solution provided in Jenkins : Selenium GUI tests are not visible on Windows are not working for me. Someone please help me in this.
Started by user Karthick Ragu
Running as SYSTEM
Building in workspace C:\Program Files\Jenkins\workspace\killerFramework
Parsing POMs
Established TCP socket on 51445
[karthick.framework] $ "C:\Program Files\Java\jdk1.8.0_181/bin/java" -cp "C:\Program Files\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven35-agent-1.13.jar;C:\Program Files\Jenkins\tools\hudson.tasks.Maven_MavenInstallation\TestMaven\boot\plexus-classworlds-2.6.0.jar;C:\Program Files\Jenkins\tools\hudson.tasks.Maven_MavenInstallation\TestMaven/conf/logging" jenkins.maven3.agent.Maven35Main "C:\Program Files\Jenkins\tools\hudson.tasks.Maven_MavenInstallation\TestMaven" "C:\Program Files\Jenkins\war\WEB-INF\lib\remoting-3.35.jar" "C:\Program Files\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven35-interceptor-1.13.jar" "C:\Program Files\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven3-interceptor-commons-1.13.jar" 51445
<===[JENKINS REMOTING CAPACITY]===>channel started
Executing Maven: -B -f D:\LEARNING\sel\karthick.framework\pom.xml clean test
[INFO] Scanning for projects...
[INFO]
[INFO] --------------< web.automation.killer:karthick.framework >--------------
[INFO] Building karthick.framework 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # karthick.framework ---
[INFO] Deleting D:\LEARNING\sel\karthick.framework\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # karthick.framework ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) # karthick.framework ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # karthick.framework ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) # karthick.framework ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 3 source files to D:\LEARNING\sel\karthick.framework\target\test-classes
[INFO]
[INFO] --- maven-surefire-plugin:3.0.0-M3:test (default-test) # karthick.framework ---
[JENKINS] Recording test results
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15.339 s
[INFO] Finished at: 2019-10-06T23:35:41+05:30
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[JENKINS] Archiving D:\LEARNING\sel\karthick.framework\pom.xml to web.automation.killer/karthick.framework/0.0.1-SNAPSHOT/karthick.framework-0.0.1-SNAPSHOT.pom
channel stopped
TestNG Reports Processing: START
Looking for TestNG results report in workspace using pattern: **/testng-results.xml
Did not find any matching files.
Finished: SUCCESS

The error is loud and clear
Looking for TestNG results report in workspace using pattern:
**/testng-results.xml Did not find any matching files.
That mean Jenkins not able to found xml file as per the path you have provided in jenkins.
Check if the path or filename is fine.
Put the full absolute path first to check and then try to create ** relative path

Related

Maven - doesnt download from https://repo1.maven.org/maven2 but trying to download from http://repo1.maven.org/maven2

I m trying to run mvn site. I tried even running dependency tree. But still i m getting the following error on console. Ideally it should fetch from https and not from http. How do we get the maven from downloading from https and not from http ?
D:\Junit\junit5-examples-master\junit5-maven>mvn site
[INFO] Scanning for projects...
[INFO]
[INFO] --------------------< com.mkyong.core:junit5-maven >--------------------
[INFO] Building junit5-maven 1.0
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from central: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-surefire-report-plugin/3.0.0-M4/maven-surefire-r
eport-plugin-3.0.0-M4.pom
Downloading from org.source.repo: https://repo1.maven.org/maven2/org/apache/maven/plugins/maven-surefire-report-plugin/3.0.0-M4/maven-s
urefire-report-plugin-3.0.0-M4.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.063 s
[INFO] Finished at: 2020-01-20T17:14:59+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project junit5-maven: Could not resolve dependencies for project com.mkyong.core:junit5-maven:jar:1.0
: Failed to collect dependencies at org.apache.maven.plugins:maven-surefire-report-plugin:jar:3.0.0-M4: Failed to read artifact descrip
tor for org.apache.maven.plugins:maven-surefire-report-plugin:jar:3.0.0-M4: Could not transfer artifact org.apache.maven.plugins:maven-
surefire-report-plugin:pom:3.0.0-M4 from/to central (http://repo1.maven.org/maven2/): Failed to transfer file http://repo1.maven.org/ma
ven2/org/apache/maven/plugins/maven-surefire-report-plugin/3.0.0-M4/maven-surefire-report-plugin-3.0.0-M4.pom with status code 501 -> [
Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
Pl assist.
Regards,

How to get 'mvn lagom:runAll' to get my service listening on a port?

I was having problems getting my first service to run and decided to add the hello-api and hello-impl projects from the lagom Maven archtype project to see if it would work. It did but mine do not.
Background
Since other team members are pure Java developers, I was trying to avoid leveraging sbt and activator. Thus, the objective is that everything works in maven.
Here's a snippet of the 'mvn install' script output to show the other services built.
$ mvn install
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] Archetype - mai-svcs
[INFO] mai-svc-common
[INFO] mai-actors-api <======= WANT THE SERVICE FOR THIS ONE TO RUN
[INFO] mai-namespace-api
[INFO] mai-actors-impl
[INFO] mai-namespace-impl
[INFO] mai-i18n-phrases-api
[INFO] hello-api
[INFO] hello-impl
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Archetype - mai-svcs 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Archetype - mai-svcs ............................... SUCCESS [ 2.774 s]
[INFO] mai-svc-common ..................................... SUCCESS [ 7.190 s]
[INFO] mai-actors-api ..................................... SUCCESS [ 24.706 s]
[INFO] mai-namespace-api .................................. SUCCESS [ 12.628 s]
[INFO] mai-actors-impl .................................... SUCCESS [ 29.061 s]
[INFO] mai-namespace-impl ................................. SUCCESS [ 21.294 s]
[INFO] mai-i18n-phrases-api ............................... SUCCESS [ 22.091 s]
[INFO] hello-api .......................................... SUCCESS [ 3.546 s]
NOTES: An MAIActorsModule class analogous to the HelloModule class was created and the application.conf file added in the src/main/resources folder.
When the command 'mvn lagom:runAll' is issued, initially, the services are the hello service port is logged but no other service's port is.
$ mvn lagom:runAll
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] Archetype - mai-svcs
[INFO] mai-svc-common
[INFO] mai-actors-api
[INFO] mai-namespace-api
[INFO] mai-actors-impl
[INFO] mai-namespace-impl
[INFO] mai-i18n-phrases-api
[INFO] hello-api
[INFO] hello-impl
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Archetype - mai-svcs 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- lagom-maven-plugin:1.2.1:runAll (default-cli) # mai-svcs ---
[INFO] Starting Kafka
[INFO] Starting Cassandra
.[INFO] Did not find Netty's native epoll transport in the classpath, defaulting to NIO.
....[INFO] Using data-center name 'datacenter1' for DCAwareRoundRobinPolicy (if this is incorrect, please provide the correct datacenter name with DCAwareRoundRobinPolicy constructor)
[INFO] New Cassandra host /127.0.0.1:4000 added
[INFO] Cassandra server running at 127.0.0.1:4000
[INFO] Service locator is running at http://localhost:8000
[INFO] Service gateway is running at http://localhost:9000
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Users\lusp\mai_svcs\mai-svcs\hello-api\src\main\resources
[INFO] Nothing to compile - all classes are up to date
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
**[INFO] Nothing to compile - all classes are up to date
[INFO] Service hello-impl listening for HTTP on 0:0:0:0:0:0:0:0:57797
// ----- NO ENTRY FOR mai-actors-impl!!! -----
[INFO] (Service started, press enter to stop and go back to the console...)**
What step(s) did I miss?
Each of your <service>-impl projects need to:
Invoke the lagom-maven-plugin
Configure it with the property <lagomService>true</lagomService>
Here's an example snippet of what you need to add to your pom.xml file in each service implementation project:
<build>
<plugins>
<plugin>
<groupId>com.lightbend.lagom</groupId>
<artifactId>lagom-maven-plugin</artifactId>
<configuration>
<lagomService>true</lagomService>
</configuration>
</plugin>
</plugins>
</build>
The Lagom documentation has more details in the page titled Defining a Lagom build

How to run javaee7 sdk samples?

My teacher want me to run javaee7 sdk sample "annotation-war". Then I download the javaee7 sdk from http://www.oracle.com/technetwork/java/javaee/downloads/index.html. But, I don't know how to run it.
I have tried the following steps:
First, I import code into Intelij IDEA, and run mvn cargo:run, but some error happen
"C:\Program Files\Java\jdk1.8.0_101\bin\java" -Dmaven.multiModuleProjectDirectory=C:\zjf\code\IDEA\javaee_samples\servlet\annotation-war -Dmaven.home=C:\zjf\soft\apache-maven-3.3.9 -Dclassworlds.conf=C:\zjf\soft\apache-maven-3.3.9\bin\m2.conf -Didea.launcher.port=7532 "-Didea.launcher.bin.path=C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 2016.3\bin" -Dfile.encoding=UTF-8 -classpath "C:\zjf\soft\apache-maven-3.3.9\boot\plexus-classworlds-2.5.2.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 2016.3\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain org.codehaus.classworlds.Launcher -Didea.version=2016.3 -s C:\zjf\soft\apache-maven-3.3.9\conf\settings.xml -Dmaven.repo.local=C:\zjf\soft\apache-maven-3.3.9\repo org.codehaus.cargo:cargo-maven2-plugin:1.4.0:run
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building annotation-war 4.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- cargo-maven2-plugin:1.4.0:run (default-cli) # annotation-war ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.422 s
[INFO] Finished at: 2016-12-06T19:12:34+08:00
[INFO] Final Memory: 8M/184M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.4.0:run (default-cli) on project annotation-war: Execution default-cli of goal org.codehaus.cargo:cargo-maven2-plugin:1.4.0:run failed: Cannot create configuration. There's no registered configuration for the parameters (container [id = [glassfish4x], type = [installed]], configuration type [standalone]). Actually there are no valid types registered for this configuration. Maybe you've made a mistake spelling it? -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
Process finished with exit code 1
Then I think may be I have done the wrong thing, so I read the docs in "annotation-war". It's ok to run mvn clean and mvn verify. But when I run mvn cargo:run -Dglassfish.home=C:\zjf\soft\glassfish, I still encounter the same problem:
C:\zjf\code\IDEA\javaee_samples\servlet\annotation-war>mvn cargo:run -Dglassfish.home=C:\zjf\soft\glassfish
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building annotation-war 4.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- cargo-maven2-plugin:1.4.0:run (default-cli) # annotation-war ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.038 s
[INFO] Finished at: 2016-12-06T20:59:57+08:00
[INFO] Final Memory: 8M/184M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.4.0:run (default-cli) on project annotation-war: Execution default-cli of goal org.codehaus.cargo:cargo-maven2-plugin:1.4.0:run failed: Cannot create configuration. There's no registered configuration for the parameters (container [id = [glassfish4x], type = [installed]], configuration type [standalone]). Actually there are no valid types registered for this configuration. Maybe you've made a mistake spelling it? -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
I really don't know how to run javaee SDK samples. Can anyone who know how to run it give me some help?
The simplest way to get it running is to first build the project with mvn install which will output a WAR file. The bottom of the log will tell you the full, absolute path to the WAR file. the install Maven goal will also put copy it to your local repository which is managed by Maven, so you will see two different paths to the same WAR file. Either of these works, e.g:
/path/to/my/app/target/annotation-war-1.0.0-SNAPSHOT.war
You can then use the asadmin tool in GlassFish to deploy the WAR file, first making sure GlassFish is running:
C:\zjf\soft\glassfish\glassfish4\bin\asadmin start-domain
C:\zjf\soft\glassfish\glassfish4\bin\asadmin deploy /path/to/my/app/target/annotation-war-1.0.0-SNAPSHOT.war
This isn't the only way to get it running (there are many) but you may find this is the easiest to undestand, with the fewest things that might go wrong, despite it being a bit long-winded.

Jenkins not running TestNG Tests

I've got an TestNG project which was running on Jenkins. For some reason which I don't know it stopped running the tests. It compiles perfectly but it doesn't run the the test. Here is the output of a run:
<===[JENKINS REMOTING CAPACITY]===>channel started
log4j:WARN No appenders could be found for logger
(org.apache.commons.beanutils.converters.BooleanConverter).
log4j:WARN Please initialize the log4j system properly.
Executing Maven: -B -f C:\Java\jenkins-1.523\workspace\TEST_HEAD_NOEXPORT\CMS-WEB SELENIUM-WEB-TEST\pom.xml clean install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building TEST-CMS-WEB 0.0.1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) # Web ---
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) # Web ---
[debug] execute contextualize
[INFO] Using 'cp1252' encoding to copy filtered resources.
[INFO] Copying 69 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) # Web ---
[INFO] Compiling 73 source files to C:\Java\jenkins-1.523\workspace\TEST_HEAD_NOEXPORT\CMS-WEB\SELENIUM-WEB-TEST\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) # Web ---
[debug] execute contextualize
[INFO] Using 'cp1252' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Java\jenkins-1.523\workspace\TEST_HEAD_NOEXPORT\CMS-WEB\SELENIUM-WEB-TEST\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) # Web ---
[INFO] Compiling 2 source files to C:\Java\jenkins-1.523\workspace\TEST_HEAD_NOEXPORT\CMS-WEB\SELENIUM-WEB-TEST\target\test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # Web ---
[JENKINS] Recording test results
[INFO]
[INFO] --- maven-jar-plugin:2.3.2:jar (default-jar) # Web ---
[INFO] Building jar: C:\Java\jenkins-1.523\workspace\TEST_HEAD_NOEXPORT\CMS-WEB\SELENIUM-WEB-TEST\target\Web-0.0.1.jar
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install (default-install) # Web ---
[INFO] Installing C:\Java\jenkins-1.523\workspace\TEST_HEAD_NOEXPORT\CMS-WEB\SELENIUM-WEB-TEST\target\Web-0.0.1.jar to C:\.m2\repository\Test\Web\0.0.1\Web-0.0.1.jar
[INFO] Installing C:\Java\jenkins-1.523\workspace\TEST_HEAD_NOEXPORT\CMS-WEB\SELENIUM-WEB-TEST\pom.xml to C:\.m2\repository\Test\Web\0.0.1\Web-0.0.1.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.211s
[INFO] Finished at: Wed Jan 15 14:21:03 UYST 2014
[INFO] Final Memory: 26M/310M
[INFO] ------------------------------------------------------------------------
[JENKINS] Archiving C:\Java\jenkins-1.523\workspace\TEST_HEAD_NOEXPORT\CMS-WEB\SELENIUM-WEB-TEST\pom.xml to C:\Java\jenkins-1.523\jobs\TEST_HEAD_NOEXPORT\modules\Test$Web\builds\2014-01-15_14-20-56\archive\Test\Web\0.0.1\Web-0.0.1.pom
[JENKINS] Archiving C:\Java\jenkins-1.523\workspace\TEST_HEAD_NOEXPORT\CMS-WEB\SELENIUM-WEB-TEST\target\Web-0.0.1.jar to C:\Java\jenkins-1.523\jobs\TEST_HEAD_NOEXPORT\modules\Test$Web\builds\2014-01-15_14-20-56\archive\Test\Web\0.0.1\Web-0.0.1.jar
Waiting for Jenkins to finish collecting data
If anyone knows what could be happening I would appreciate the help.
If your using Maven Surefire, did you correctly specify a "test include" filter? The test phase will search the packages in src/test/java for classes containing the #Test annotation. It's easy to misconfigure Maven for the location of the src/test/java directory and so just be careful and you will figure it out.
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M3</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
Include maven surefire plugin end of the properties & before the dependencies. Use your "TestNG" XML file name.Use above code.

Maven install/compile Failure

I am getting below exception , When i compile/install through maven in command prompt / eclipse.
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) # dashboard ---
May 22, 2013 3:55:50 PM org.sonatype.guice.bean.reflect.Logs$JULSink warnWARNING: Error injecting: org.apache.maven.plugin.resources.ResourcesMojo java.lang.NoClassDefFoundError: org/apache/maven/shared/filtering/MavenFiltering
Exception
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2413)
at java.lang.Class.getDeclaredConstructors(Class.java:1855)
at com.google.inject.spi.InjectionPoint.forConstructorOf(InjectionPoint.
java:245)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.050s
[INFO] Finished at: Wed May 22 15:55:50 MDT 2013
[INFO] Final Memory: 9M/111M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.5:resources (default-resources) on project dashboard: Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:2.5:resources failed: A required class was missing while executing org.apache.maven.plugins:maven-resources-plugin:2.5:resources: org/apache/maven/shared/filtering/MavenFilteringException
I have tried by changing the repository location and also deleting the existing plugins in the repository directory.
Try if another task locks the maven-filtering jar file (.m2/repository/org/apache/maven/shared/maven-filtering/1.xx/maven-filtering-1.xx.jar). In my case Eclipse had locked that file somehow. Kill that task and maven should be ok.