Thursday, June 20, 2024

Maven Build Lilfe Cycle

 

Maven Build Life cycle :

Once java code is developed > Maven perform below activities


maven  >  takes all java src code >  compile all java files >  .class >  run all classes > test >  build .jar file  >  install .jar in local Repo --> deploy created .jar file into remote repo.



----------------------------------------------------------

A Build Lifecycle is Made Up of Phases

Each of these build lifecycles is defined by a different list of build phases, wherein a build phase represents a stage in the lifecycle.


For example, the default lifecycle comprises of the following phases (for a complete list of the lifecycle phases, refer to the Lifecycle Reference):

------------

Validate

Compile

test


Package

verify


install

deploy

------------

validate - validate the project is correct and all necessary information is available

  validate pom.xml is correct


compile - compile the source code of the project

   target folder 


test - test the compiled source code using a suitable unit testing framework. These tests should not require the code be packaged or deployed

package - take the compiled code and package it in its distributable format, such as a JAR.


verify - run any checks on results of integration tests to ensure quality criteria are met


install - install the package (.jar) into the local repository, for use as a dependency in other projects locally


deploy - done in the build environment, copies the final package to the remote repository for sharing with other developers and projects.


******************************************

FAQ what is Maven Build life cycle ?


Refer :  https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html


Revise:

-------

validate -- > check pom.xml is correct or not  or project info is correct

compile --> src/test/java --  compile -->  .class 

test -->  run all .class file -- >  


package --> take compiled class file >     combine/build /package --  into single .jar file 

verify  ->  verifies integrating classes are working fine or not 


install --> install created .jar file into Local repo

deploy -->  it installs created .jar file into Remote repository (Server)


 100 classes -- Dev -developed -  copy  all 100 classes in server ...


  deployment -->   Developer copy ".jar" in server machine (or) remote machine but not 100 java class files


Run Specific xml file using Maven Command

 


parameterisation of xml file in POM.xml file :

------------------------------------------


and Runnning Testng.Xml  file in cmd prompt window

---------------------------------------------

 <configuration>

            <suiteXmlFiles>

           <!--  <suiteXmlFile>testng.xml</suiteXmlFile>

            <suiteXmlFile>testng2.xml </suiteXmlFile> -->

            

            <!-- <suiteXmlFile>C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand\src\test\Resources\Runner\testng.xml </suiteXmlFile>

             -->

        <!--     <suiteXmlFile>src\test\Resources\Runner\testng.xml </suiteXmlFile>

            <suiteXmlFile>src\test\Resources\Runner\testng2.xml </suiteXmlFile>  -->

            

            <suiteXmlFile>${suiteXmlFile} </suiteXmlFile>         

                        

          </suiteXmlFiles>

        </configuration>

      </plugin>

-------------------------------------




Syntax :

--------


run single class -->   mvn test -Dtest= class1

run multiple classes -->  mvn test -Dtest = class1,class2,class3...etc

Run all maven test classes --> mvn test - if class name ends with "Test" it will run all classes

Run testng.xml file --> mvn test -DsuiteXmlFile= xmlFileName.xml

  

ex 1: run single testng.xml --> mvn test -DsuiteXmlFile=testng.xml



ex 2:

run "testng2.xml"  cmd   --> mvn test -DsuiteXmlFile=testng2.xml



Execute above commands :

------------------------

C:\brahma\Practise\SelniumPractiseNew\Jul2023WorkSpace\MavenProjectThroughCommand>mvn test -DsuiteXmlFile=testng.xml


C:\brahma\Practise\SelniumPractiseNew\Jul2023WorkSpace\MavenProjectThroughCommand>mvn test -DsuiteXmlFile=testng2.xml



(or )

we can use this also 

mvn  clean test -DsuiteXmlFile=testng.xml



ex:


C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand>mvn test -DsuiteXmlFile=testng.xml

[INFO] Scanning for projects...

[INFO]

[INFO] ----------------< com.birla:MavenProjectThroughCommand >----------------

[INFO] Building MavenProjectThroughCommand 1.0-SNAPSHOT

[INFO] --------------------------------[ jar ]---------------------------------

[INFO]

[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ MavenProjectThroughCommand ---

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] skip non existing resourceDirectory C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand\src\main\resources

[INFO]

[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ MavenProjectThroughCommand ---

[INFO] Nothing to compile - all classes are up to date

[INFO]

[INFO] --- maven-resources-plugin:3.0.2:testResources (default-testResources) @ MavenProjectThroughCommand ---

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] Copying 2 resources

[INFO]

[INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ MavenProjectThroughCommand ---

[INFO] Nothing to compile - all classes are up to date

[INFO]

[INFO] --- maven-surefire-plugin:3.1.2:test (default-test) @ MavenProjectThroughCommand ---

[INFO] Using auto detected provider org.apache.maven.surefire.testng.TestNGProvider

[INFO]

[INFO] -------------------------------------------------------

[INFO]  T E S T S

[INFO] -------------------------------------------------------

[INFO] Running TestSuite

hi IOS Test

[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.039 s -- in TestSuite

[INFO]

[INFO] Results:

[INFO]

[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[INFO]

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

[INFO] Total time:  4.979 s

[INFO] Finished at: 2024-06-20T09:05:57+05:30

[INFO] ------------------------------------------------------------------------


C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand>mvn test -DsuiteXmlFile=testng2.xml

[INFO] Scanning for projects...

[INFO]

[INFO] ----------------< com.birla:MavenProjectThroughCommand >----------------

[INFO] Building MavenProjectThroughCommand 1.0-SNAPSHOT

[INFO] --------------------------------[ jar ]---------------------------------

[INFO]

[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ MavenProjectThroughCommand ---

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] skip non existing resourceDirectory C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand\src\main\resources

[INFO]

[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ MavenProjectThroughCommand ---

[INFO] Nothing to compile - all classes are up to date

[INFO]

[INFO] --- maven-resources-plugin:3.0.2:testResources (default-testResources) @ MavenProjectThroughCommand ---

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] Copying 2 resources

[INFO]

[INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ MavenProjectThroughCommand ---

[INFO] Nothing to compile - all classes are up to date

[INFO]

[INFO] --- maven-surefire-plugin:3.1.2:test (default-test) @ MavenProjectThroughCommand ---

[INFO] Using auto detected provider org.apache.maven.surefire.testng.TestNGProvider

[INFO]

[INFO] -------------------------------------------------------

[INFO]  T E S T S

[INFO] -------------------------------------------------------

[INFO] Running TestSuite

Calling Mobile Test

[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.026 s -- in TestSuite

[INFO]

[INFO] Results:

[INFO]

[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[INFO]

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

[INFO] Total time:  5.443 s

[INFO] Finished at: 2024-06-20T09:09:47+05:30

[INFO] ------------------------------------------------------------------------


C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand>




Run "Multiple" testng.xml files cmd :

----------------------------------


run "single" testng.xml file -->  mvn test -DsuiteXmlFile=testng.xml

run "multiple" xml files     -->  mvn test -DsuiteXmlFile=testng.xml,testng2.xml, testng3.xml,...

mvn test -DsuiteXmlFile=testng.xml,testng2.xml  --Dont give spaces -- working


 ex 2:

mvn clean test -DsuiteXmlFile=testng.xml,testng2.xml  -- working


invalid :

mvn clean test -DsuiteXmlFiles=testng.xml,testng2.xml  ---> invalid command - dont use 'suiteXmlFiles'


run :

[INFO] ------------------------------------------------------------------------

[INFO] BUILD FAILURE

[INFO] ------------------------------------------------------------------------

[INFO] Total time:  5.259 s

[INFO] Finished at: 2023-10-24T09:32:40+05:30

[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.1.2:test (default-test) on project MavenProjectThroughCommand: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:3.1.2:test failed: testSuiteXmlFiles0 has null value -> [Help 1]

[ERROR]



when we get above error- there is some  problem in maven cmd..check maven command properly. 




Syntax 2:

------------

mvn test -Dsurefire.suiteXmlFiles=testng.xml,testng2.xml --> ok

mvn test -Dsurefire.suiteXmlFiles= testng.xml,testng2.xml --->  not working --  dont use spaces for xml files

            (or)

mvn clean test -Dsurefire.suiteXmlFiles=testng.xml,testng2.xml  --> Valid- working 



note:

------

Run "specific test Method"  from given class , from given testng.xml file:

-----------------------------------------------------



public class TestAnnonation1 {


@Test  //   define annotation before method   or Test method or Test annontatin method or Test case

public void testA() // normal java method

{

System.out.println("stmt-1 from test A()");

System.out.println("stmt-2 from testA()");

}

@Test  //   define annotation before method   or Test method or Test annontatin method or Test case

public void testA2() // normal java method

{

System.out.println("stmt-1 from test A2()");

System.out.println("stmt-2 from testA2()");

}


}



-----------------------------

Syntax:

-------

mvn test -DsuiteXmlFile=testng.xml -Dtest=className1#testMethodName


ex1:  run testA() method from class 'TestAnnonation1'  from testng.xml file 

 mvn test -DsuiteXmlFile=testng.xml -Dtest=TestAnnonation1#testA


ex2:

Run testB () Method

 mvn test -DsuiteXmlFile=testng.xml -Dtest=TestAnnonation1#testB



Run 'multiple test' methods from given class :

-------------------------------------------

Syntax:

--------


 mvn  test -DsuiteXmlFile=testng.xml-Dtest="ClassName#Testmethod1+Testmethod2"


ex:  run testA  and testA2

mvn test -DsuiteXmlFile=testng.xml -Dtest="TestAnnonation1#testA+testB"

  (or)

mvn test -DsuiteXmlFile=testng.xml -Dtest=TestAnnonation1#testA+testB






HW Create 3 (or) 4 Test Methods   run  1 test method using maven cmd ?


HW same as previous question, run  3 test methods using maven cmd ?



Maven Basics for Automation Testing-4

 The Maven Surefire Plugin can be used to run testng.xml files.

Refer to the official documentation: Maven Surefire Plugin - TestNG.

Add Plugin and Dependency to pom.xml

Add the Maven Surefire plugin configuration and TestNG dependency:

xml
<plugins> <!-- Other plugins --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>3.1.2</version> <configuration> <suiteXmlFiles> <suiteXmlFile>testng.xml</suiteXmlFile> </suiteXmlFiles> </configuration> </plugin> </plugins>

Add TestNG dependency:

xml
<dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> <version>7.0.0</version> <scope>test</scope> </dependency>

Step 8: Create TestNG Classes and XML

Create classes in the com.birla package:

java
package com.birla; import static org.testng.Assert.assertTrue; import org.testng.annotations.Test; public class AndroidTest { @Test public void testB() { System.out.println("Calling Android Test"); assertTrue(true); } }
java
package com.birla; import static org.testng.Assert.assertTrue; import org.testng.annotations.Test; public class MobileTest { @Test public void testA() { System.out.println("Calling Mobile Test"); assertTrue(true); } }
java
package com.birla; import org.testng.annotations.Test; class iosTest { @Test public void testC() { System.out.println("hi IOS Test"); } }

Create testng.xml:

xml
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd"> <suite name="Suite"> <test thread-count="5" name="Test"> <classes> <class name="com.birla.iosTest"/> <class name="com.birla.MobileTest"/> <class name="com.birla.AndroidTest"/> </classes> </test> </suite>

Step 9: Run testng.xml File from pom.xml

Add the relative path to testng.xml in pom.xml:

xml
<plugins> <!-- Other plugins --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>3.1.2</version> <configuration> <suiteXmlFiles> <suiteXmlFile>src/test/Resources/Runner/testng.xml</suiteXmlFile> </suiteXmlFiles> </configuration> </plugin> </plugins>

Step 10: Run Maven Test

Run as Maven test.

Homework:

  • Create a testng.xml and run it using Maven.

By following these steps, you will successfully create, configure, and run a Maven project with TestNG tests using the Maven Surefire plugin.

Maven Basic Commands for Automation Testing -3

 


-------------------------------

Some Important Maven commands:

------------------------------


mvn test

mvn clean

mvn compile

--------------


mvn test  - cmd - can be used to run maven tests/classes


steps:  Open Maven Project in cmd prompt window 


Go to ur  Maven Project folder > 

C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand>mvn test


o/p:

----


C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand>mvn test

[INFO] Scanning for projects...

[INFO]

[INFO] ----------------< com.birla:MavenProjectThroughCommand >----------------

[INFO] Building MavenProjectThroughCommand 1.0-SNAPSHOT

[INFO] --------------------------------[ jar ]---------------------------------

[INFO]

[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ MavenProjectThroughCommand ---

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] skip non existing resourceDirectory C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand\src\main\resources

[INFO]

[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ MavenProjectThroughCommand ---

[INFO] Nothing to compile - all classes are up to date

[INFO]

[INFO] --- maven-resources-plugin:3.0.2:testResources (default-testResources) @ MavenProjectThroughCommand ---

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] skip non existing resourceDirectory C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand\src\test\resources

[INFO]

[INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ MavenProjectThroughCommand ---

[INFO] Nothing to compile - all classes are up to date

[INFO]

[INFO] --- maven-surefire-plugin:2.22.1:test (default-test) @ MavenProjectThroughCommand ---

[INFO]

[INFO] -------------------------------------------------------

[INFO]  T E S T S

[INFO] -------------------------------------------------------

[INFO] Running com.birla.AndroidTest

Calling Android Test

[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.12 s - in com.birla.AndroidTest

[INFO] Running com.birla.AppTest

running maven test

[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.005 s - in com.birla.AppTest

[INFO] Running com.birla.MobileTest

Calling Mobile Test

[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.011 s - in com.birla.MobileTest

[INFO]

[INFO] Results:

[INFO]

[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0

[INFO]

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

[INFO] Total time:  4.214 s

[INFO] Finished at: 2024-06-19T08:43:18+05:30

[INFO] ------------------------------------------------------------------------

-----------------------

Note:

----

if we execute mvn test cmd from other/ invalid folder where pom.xml file is not available, it throws "Build failure " error


-----------------------------------

Microsoft Windows [Version 10.0.19045.3570]

(c) Microsoft Corporation. All rights reserved.


C:\Users\Lenovo>mvn test


[INFO] Scanning for projects...

[INFO] ------------------------------------------------------------------------

[INFO] BUILD FAILURE

[INFO] ------------------------------------------------------------------------

[INFO] Total time:  0.193 s

[INFO] Finished at: 2023-10-23T08:55:04+05:30

[INFO] ------------------------------------------------------------------------

[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (C:\Users\Lenovo). Please verify you invoked Maven from the correct directory. -> [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/MissingProjectException


C:\Users\Lenovo>



---------------------------------------------------


When we run maven test >  goes to src\test\java  >  it compiles  all "java" files and creates ".class" files in 'target' folder > i.e C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand\target\test-classes\com\birla

or  also creates some temp files in'target' folder

---------------------------------------------------

mvn clean cmd :

-------------

     - can be used to delete/ clean all temporary folder i.e in target folder and files what ever maven created 



o/p:

----

Microsoft Windows [Version 10.0.19045.4529]

(c) Microsoft Corporation. All rights reserved.


C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand>mvn clean

[INFO] Scanning for projects...

[INFO]

[INFO] ----------------< com.birla:MavenProjectThroughCommand >----------------

[INFO] Building MavenProjectThroughCommand 1.0-SNAPSHOT

[INFO] --------------------------------[ jar ]---------------------------------

[INFO]

[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ MavenProjectThroughCommand ---

[INFO] Deleting C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand\target

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

[INFO] Total time:  0.966 s

[INFO] Finished at: 2024-06-19T08:55:19+05:30

[INFO] ------------------------------------------------------------------------


C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand>


*******************************************


clean through Eclipse: 

----------------

  Rt click on Project > Run as 'Maven clean' option >


o/p:


SLF4J: Class path contains multiple SLF4J bindings.

SLF4J: Found binding in [jar:file:/C:/brahma/seleniumSoftwares/eclipse-jee-2021-03-M2-win32-x86_64/eclipse/plugins/org.eclipse.m2e.maven.runtime.slf4j.simple_1.16.0.20200610-1735/jars/slf4j-simple-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: Found binding in [file:/C:/brahma/seleniumSoftwares/eclipse-jee-2021-03-M2-win32-x86_64/eclipse/configuration/org.eclipse.osgi/6/0/.cp/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.

SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]

SLF4J: Class path contains multiple SLF4J bindings.

SLF4J: Found binding in [jar:file:/C:/brahma/seleniumSoftwares/eclipse-jee-2021-03-M2-win32-x86_64/eclipse/plugins/org.eclipse.m2e.maven.runtime.slf4j.simple_1.16.0.20200610-1735/jars/slf4j-simple-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: Found binding in [file:/C:/brahma/seleniumSoftwares/eclipse-jee-2021-03-M2-win32-x86_64/eclipse/configuration/org.eclipse.osgi/6/0/.cp/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.

SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]

[INFO] Scanning for projects...

[INFO] 

[INFO] ----------------< com.birla:MavenProjectThroughCommand >----------------

[INFO] Building MavenProjectThroughCommand 1.0-SNAPSHOT

[INFO] --------------------------------[ jar ]---------------------------------

[INFO] 

[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ MavenProjectThroughCommand ---

[INFO] Deleting C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand\target

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

[INFO] Total time:  0.781 s

[INFO] Finished at: 2024-06-19T08:58:21+05:30

[INFO] ------------------------------------------------------------------------


HW :  run maven clean cmd from cmd prompt window :


mvn test  -->  to run maven test/classes  where class name ends with 'Test'

mvn clean -->   clean/ delete temp folders in "target" folder what ever Maven created inside "target" folder


compile :

------------

mvn compile - cmd - can be used to "compile" all java files from 'src\test\java' folder 

it takes java classes >  compile - converting java file to .class files


o/p:

----

Microsoft Windows [Version 10.0.19045.4529]

(c) Microsoft Corporation. All rights reserved.


C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand>mvn compile

[INFO] Scanning for projects...

[INFO]

[INFO] ----------------< com.birla:MavenProjectThroughCommand >----------------

[INFO] Building MavenProjectThroughCommand 1.0-SNAPSHOT

[INFO] --------------------------------[ jar ]---------------------------------

[INFO]

[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ MavenProjectThroughCommand ---

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] skip non existing resourceDirectory C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand\src\main\resources

[INFO]

[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ MavenProjectThroughCommand ---

[INFO] Changes detected - recompiling the module!

[INFO] Compiling 1 source file to C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand\target\classes

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

[INFO] Total time:  2.420 s

[INFO] Finished at: 2024-06-19T09:01:53+05:30

[INFO] ------------------------------------------------------------------------


C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand>


------------------------------

Note: 

-----

we can see all compiled files here

 

C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand>\target\classes

(or) 

C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand>\target\test-classes\com\birla


--------------------------------------------


Note:

-----

if class name does not end with 'Test' - Maven will run that class (or) not ? 

  No.it does not run class as tge class name does not end with "Test"

Class IOS  

{


}


Maven will not run classes where class name does not end with 'Test'



Run 'single' Maven test from cmd:

-------------------------------

syntax: 

--------

mvn test -->  run all maven classes where class name ends with 'Test'


        mvn test -Dtest=className

ex:

I want to run class = MobileTest

cmd -->  mvn test -Dtest=MobileTest


o/p:

----

C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand>mvn test -Dtest=MobileTest

[INFO] Scanning for projects...

[INFO]

[INFO] ----------------< com.birla:MavenProjectThroughCommand >----------------

[INFO] Building MavenProjectThroughCommand 1.0-SNAPSHOT

[INFO] --------------------------------[ jar ]---------------------------------

[INFO]

[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ MavenProjectThroughCommand ---

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] skip non existing resourceDirectory C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand\src\main\resources

[INFO]

[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ MavenProjectThroughCommand ---

[INFO] Nothing to compile - all classes are up to date

[INFO]

[INFO] --- maven-resources-plugin:3.0.2:testResources (default-testResources) @ MavenProjectThroughCommand ---

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] skip non existing resourceDirectory C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand\src\test\resources

[INFO]

[INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ MavenProjectThroughCommand ---

[INFO] Changes detected - recompiling the module!

[INFO] Compiling 4 source files to C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand\target\test-classes

[INFO]

[INFO] --- maven-surefire-plugin:2.22.1:test (default-test) @ MavenProjectThroughCommand ---

[INFO]

[INFO] -------------------------------------------------------

[INFO]  T E S T S

[INFO] -------------------------------------------------------

[INFO] Running com.birla.MobileTest

Calling Mobile Test

[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.095 s - in com.birla.MobileTest

[INFO]

[INFO] Results:

[INFO]

[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[INFO]

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

[INFO] Total time:  5.467 s

[INFO] Finished at: 2024-06-19T09:07:02+05:30

[INFO] ------------------------------------------------------------------------


C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand>

ex2:

----

 I want to run class = AndroidTest

cmd --> mvn test -Dtest=AndroidTest


o/p:

----

C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand>mvn test -Dtest=AndroidTest

[INFO] Scanning for projects...

[INFO]

[INFO] ----------------< com.birla:MavenProjectThroughCommand >----------------

[INFO] Building MavenProjectThroughCommand 1.0-SNAPSHOT

[INFO] --------------------------------[ jar ]---------------------------------

[INFO]

[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ MavenProjectThroughCommand ---

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] skip non existing resourceDirectory C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand\src\main\resources

[INFO]

[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ MavenProjectThroughCommand ---

[INFO] Nothing to compile - all classes are up to date

[INFO]

[INFO] --- maven-resources-plugin:3.0.2:testResources (default-testResources) @ MavenProjectThroughCommand ---

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] skip non existing resourceDirectory C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand\src\test\resources

[INFO]

[INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ MavenProjectThroughCommand ---

[INFO] Nothing to compile - all classes are up to date

[INFO]

[INFO] --- maven-surefire-plugin:2.22.1:test (default-test) @ MavenProjectThroughCommand ---

[INFO]

[INFO] -------------------------------------------------------

[INFO]  T E S T S

[INFO] -------------------------------------------------------

[INFO] Running com.birla.AndroidTest

Calling Android Test

[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.113 s - in com.birla.AndroidTest

[INFO]

[INFO] Results:

[INFO]

[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[INFO]

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

[INFO] Total time:  4.217 s

[INFO] Finished at: 2024-06-19T09:08:05+05:30

[INFO] ------------------------------------------------------------------------


C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand>


----------------------------------------

HW write a command to Run "AppTest" class only ?


HW write a command to Run "iosTest" class only?



Note: if we give invalid class name, throws BUILD FAILURE


>mvn test -Dtest=Android


C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand>mvn test -Dtest=Android

[INFO] Scanning for projects...

[INFO]

[INFO] ----------------< com.birla:MavenProjectThroughCommand >----------------

[INFO] Building MavenProjectThroughCommand 1.0-SNAPSHOT

[INFO] --------------------------------[ jar ]---------------------------------

[INFO]

[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ MavenProjectThroughCommand ---

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] skip non existing resourceDirectory C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand\src\main\resources

[INFO]

[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ MavenProjectThroughCommand ---

[INFO] Nothing to compile - all classes are up to date

[INFO]

[INFO] --- maven-resources-plugin:3.0.2:testResources (default-testResources) @ MavenProjectThroughCommand ---

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] skip non existing resourceDirectory C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand\src\test\resources

[INFO]

[INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ MavenProjectThroughCommand ---

[INFO] Nothing to compile - all classes are up to date

[INFO]

[INFO] --- maven-surefire-plugin:2.22.1:test (default-test) @ MavenProjectThroughCommand ---

[INFO] ------------------------------------------------------------------------

[INFO] BUILD FAILURE

[INFO] ------------------------------------------------------------------------

[INFO] Total time:  2.040 s

[INFO] Finished at: 2024-06-19T09:09:33+05:30

[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project MavenProjectThroughCommand: No tests were executed!  (Set -DfailIfNoTests=false to ignore this error.) -> [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/MojoFailureException


C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand>

---------------------------------------------


Run "Multiple" maven tests/classes from cmd:

-----------------------------------------


Run "single" class -->   mvn test -Dtest=class1

syntax -->               mvn test -Dtest=classname1,classname2....etc


ex:  run only "MobileTest", "AndroidTest" classes

cmd --> mvn test -Dtest=MobileTest,AndroidTest


o/p:

----


C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand>mvn test -Dtest=MobileTest,AndroidTest

[INFO] Scanning for projects...

[INFO]

[INFO] ----------------< com.birla:MavenProjectThroughCommand >----------------

[INFO] Building MavenProjectThroughCommand 1.0-SNAPSHOT

[INFO] --------------------------------[ jar ]---------------------------------

[INFO]

[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ MavenProjectThroughCommand ---

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] skip non existing resourceDirectory C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand\src\main\resources

[INFO]

[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ MavenProjectThroughCommand ---

[INFO] Nothing to compile - all classes are up to date

[INFO]

[INFO] --- maven-resources-plugin:3.0.2:testResources (default-testResources) @ MavenProjectThroughCommand ---

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] skip non existing resourceDirectory C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand\src\test\resources

[INFO]

[INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ MavenProjectThroughCommand ---

[INFO] Nothing to compile - all classes are up to date

[INFO]

[INFO] --- maven-surefire-plugin:2.22.1:test (default-test) @ MavenProjectThroughCommand ---

[INFO]

[INFO] -------------------------------------------------------

[INFO]  T E S T S

[INFO] -------------------------------------------------------

[INFO] Running com.birla.AndroidTest

Calling Android Test

[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.128 s - in com.birla.AndroidTest

[INFO] Running com.birla.MobileTest

Calling Mobile Test

[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.007 s - in com.birla.MobileTest

[INFO]

[INFO] Results:

[INFO]

[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0

[INFO]

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

[INFO] Total time:  4.486 s

[INFO] Finished at: 2024-06-19T09:11:33+05:30

[INFO] ------------------------------------------------------------------------


C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand>


Note: 

-------

 it runs maven Test classes in "alphabetical" order..i.e AndroidTest,MobileTest



---------------------------------------------------------------


FAQ Can you tell me cmd to execute "single" maven test class ?



 mvn test -Dtest= classname

 mvn test -Dtest= classname1,Classname2

 mvn test --> runs single classes/ all classes --> runs all maven classes


FAQ what is the use of clean ?

       deletes all files / folders which are created in Target folder


FAQ what is the use mvn test cmd?

run all Maven test classes where class name ends with Test only.


--------------------------------------------------

 package cmd:

--------------------

mvn package --> can be used to "compile" classes and run all maven classes  and also  creates .jar (or) .war


.Jar file --> Java Archive file ( combine all classes and interfaces-- as one package)

.war file --> Web Archive File


o/p:

----


C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand>mvn package

[INFO] Scanning for projects...

[INFO]

[INFO] ----------------< com.birla:MavenProjectThroughCommand >----------------

[INFO] Building MavenProjectThroughCommand 1.0-SNAPSHOT

[INFO] --------------------------------[ jar ]---------------------------------

[INFO]

[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ MavenProjectThroughCommand ---

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] skip non existing resourceDirectory C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand\src\main\resources

[INFO]

[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ MavenProjectThroughCommand ---

[INFO] Nothing to compile - all classes are up to date

[INFO]

[INFO] --- maven-resources-plugin:3.0.2:testResources (default-testResources) @ MavenProjectThroughCommand ---

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] skip non existing resourceDirectory C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand\src\test\resources

[INFO]

[INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ MavenProjectThroughCommand ---

[INFO] Nothing to compile - all classes are up to date

[INFO]

[INFO] --- maven-surefire-plugin:2.22.1:test (default-test) @ MavenProjectThroughCommand ---

[INFO]

[INFO] -------------------------------------------------------

[INFO]  T E S T S

[INFO] -------------------------------------------------------

[INFO] Running com.birla.AndroidTest

Calling Android Test

[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.127 s - in com.birla.AndroidTest

[INFO] Running com.birla.AppTest

running maven test

[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 s - in com.birla.AppTest

[INFO] Running com.birla.MobileTest

Calling Mobile Test

[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.016 s - in com.birla.MobileTest

[INFO]

[INFO] Results:

[INFO]

[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0

[INFO]

[INFO]

[INFO] --- maven-jar-plugin:3.0.2:jar (default-jar) @ MavenProjectThroughCommand ---

[INFO] Building jar: C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand\target\MavenProjectThroughCommand-1.0-SNAPSHOT.jar

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

[INFO] Total time:  4.938 s

[INFO] Finished at: 2024-06-19T09:17:08+05:30

[INFO] ------------------------------------------------------------------------


C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand>


----------------------------------------------

******************************************************************

20-Jun-2024

******************************************************************

mvn install cmd:

-----------------

can be used to install .jar  file into "local" maven repository (.m2/repository)


o/p:

----


C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand>mvn install

[INFO] Scanning for projects...

[INFO]

[INFO] ----------------< com.birla:MavenProjectThroughCommand >----------------

[INFO] Building MavenProjectThroughCommand 1.0-SNAPSHOT

[INFO] --------------------------------[ jar ]---------------------------------

[INFO]

[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ MavenProjectThroughCommand ---

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] skip non existing resourceDirectory C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand\src\main\resources

[INFO]

[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ MavenProjectThroughCommand ---

[INFO] Nothing to compile - all classes are up to date

[INFO]

[INFO] --- maven-resources-plugin:3.0.2:testResources (default-testResources) @ MavenProjectThroughCommand ---

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] skip non existing resourceDirectory C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand\src\test\resources

[INFO]

[INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ MavenProjectThroughCommand ---

[INFO] Nothing to compile - all classes are up to date

[INFO]

[INFO] --- maven-surefire-plugin:2.22.1:test (default-test) @ MavenProjectThroughCommand ---

[INFO]

[INFO] -------------------------------------------------------

[INFO]  T E S T S

[INFO] -------------------------------------------------------

[INFO] Running com.birla.AndroidTest

Calling Android Test

[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.108 s - in com.birla.AndroidTest

[INFO] Running com.birla.AppTest

running maven test

[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.029 s - in com.birla.AppTest

[INFO] Running com.birla.MobileTest

Calling Mobile Test

[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.011 s - in com.birla.MobileTest

[INFO]

[INFO] Results:

[INFO]

[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0

[INFO]

[INFO]

[INFO] --- maven-jar-plugin:3.0.2:jar (default-jar) @ MavenProjectThroughCommand ---

[INFO]

[INFO] --- maven-install-plugin:2.5.2:install (default-install) @ MavenProjectThroughCommand ---

[INFO] Installing C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand\target\MavenProjectThroughCommand-1.0-SNAPSHOT.jar to C:\Users\Lenovo\.m2\repository\com\birla\MavenProjectThroughCommand\1.0-SNAPSHOT\MavenProjectThroughCommand-1.0-SNAPSHOT.jar


[INFO] Installing C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand\pom.xml to C:\Users\Lenovo\.m2\repository\com\birla\MavenProjectThroughCommand\1.0-SNAPSHOT\MavenProjectThroughCommand-1.0-SNAPSHOT.pom

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

[INFO] Total time:  5.943 s

[INFO] Finished at: 2024-06-20T08:09:12+05:30

[INFO] ------------------------------------------------------------------------


C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand>


Note:

-----


check the .jar file is created /installed in local maven repo.


Installing C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand>\target\MavenProjectThroughCommand-1.0-SNAPSHOT.jar

to 

C:\Users\Lenovo\.m2\repository\com\accenture\MavenProjectThroughCommand\1.0-SNAPSHOT\MavenProjectThroughCommand-1.0-SNAPSHOT.jar


------------------------------------


run From Eclipse :  Run as maven install :

------------------------------------------


SLF4J: Class path contains multiple SLF4J bindings.

SLF4J: Found binding in [jar:file:/C:/brahma/seleniumSoftwares/eclipse-jee-2021-03-M2-win32-x86_64/eclipse/plugins/org.eclipse.m2e.maven.runtime.slf4j.simple_1.16.0.20200610-1735/jars/slf4j-simple-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: Found binding in [file:/C:/brahma/seleniumSoftwares/eclipse-jee-2021-03-M2-win32-x86_64/eclipse/configuration/org.eclipse.osgi/6/0/.cp/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.

SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]

SLF4J: Class path contains multiple SLF4J bindings.

SLF4J: Found binding in [jar:file:/C:/brahma/seleniumSoftwares/eclipse-jee-2021-03-M2-win32-x86_64/eclipse/plugins/org.eclipse.m2e.maven.runtime.slf4j.simple_1.16.0.20200610-1735/jars/slf4j-simple-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: Found binding in [file:/C:/brahma/seleniumSoftwares/eclipse-jee-2021-03-M2-win32-x86_64/eclipse/configuration/org.eclipse.osgi/6/0/.cp/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.

SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]

[INFO] Scanning for projects...

[INFO] 

[INFO] ----------------< com.birla:MavenProjectThroughCommand >----------------

[INFO] Building MavenProjectThroughCommand 1.0-SNAPSHOT

[INFO] --------------------------------[ jar ]---------------------------------

[INFO] 

[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ MavenProjectThroughCommand ---

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] skip non existing resourceDirectory C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand\src\main\resources

[INFO] 

[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ MavenProjectThroughCommand ---

[INFO] Nothing to compile - all classes are up to date

[INFO] 

[INFO] --- maven-resources-plugin:3.0.2:testResources (default-testResources) @ MavenProjectThroughCommand ---

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] skip non existing resourceDirectory C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand\src\test\resources

[INFO] 

[INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ MavenProjectThroughCommand ---

[INFO] Nothing to compile - all classes are up to date

[INFO] 

[INFO] --- maven-surefire-plugin:2.22.1:test (default-test) @ MavenProjectThroughCommand ---

[INFO] 

[INFO] -------------------------------------------------------

[INFO]  T E S T S

[INFO] -------------------------------------------------------

[INFO] Running com.birla.AndroidTest

Calling Android Test

[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.178 s - in com.birla.AndroidTest

[INFO] Running com.birla.AppTest

running maven test

[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.04 s - in com.birla.AppTest

[INFO] Running com.birla.MobileTest

Calling Mobile Test

[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 s - in com.birla.MobileTest

[INFO] 

[INFO] Results:

[INFO] 

[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0

[INFO] 

[INFO] 

[INFO] --- maven-jar-plugin:3.0.2:jar (default-jar) @ MavenProjectThroughCommand ---

[INFO] 

[INFO] --- maven-install-plugin:2.5.2:install (default-install) @ MavenProjectThroughCommand ---

[INFO] Installing C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand\target\MavenProjectThroughCommand-1.0-SNAPSHOT.jar to C:\Users\Lenovo\.m2\repository\com\birla\MavenProjectThroughCommand\1.0-SNAPSHOT\MavenProjectThroughCommand-1.0-SNAPSHOT.jar

[INFO] Installing C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand\pom.xml to C:\Users\Lenovo\.m2\repository\com\birla\MavenProjectThroughCommand\1.0-SNAPSHOT\MavenProjectThroughCommand-1.0-SNAPSHOT.pom

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

[INFO] Total time:  11.688 s

[INFO] Finished at: 2024-06-20T08:12:50+05:30

[INFO] ------------------------------------------------------------------------


*************************************


*************************************


Maven goal:

-------------

    ==  maven cmd

each cmd - performs specific task


mvn clean

mvn compile

mvn test 



mvn package  -- create .jar file from compiled classes


mvn install  -- install created .jar file into local repository (.m2\repository)


Note:

-----

mvn test -->  mvn compile cmd also  and run

mvn package -->  it executes mvn compile and mvn test +   create .jar (or) .war

mvn install  --> it executes mvn compile and mvn test , mvn package  +  install .jar into Local repo


***************************************************

mvn deploy: install .jar file ( deploy the code)  in remote repository


[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy) on project MavenProjMrngCmd: Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter -> [Help 1]



--------------------------------------


Note: even if we close eclipse, we can run maven tests from cmd. 

--------------------------------------------------------------


C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand>mvn test

[INFO] Scanning for projects...

[INFO]

[INFO] ----------------< com.birla:MavenProjectThroughCommand >----------------

[INFO] Building MavenProjectThroughCommand 1.0-SNAPSHOT

[INFO] --------------------------------[ jar ]---------------------------------

[INFO]

[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ MavenProjectThroughCommand ---

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] skip non existing resourceDirectory C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand\src\main\resources

[INFO]

[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ MavenProjectThroughCommand ---

[INFO] Nothing to compile - all classes are up to date

[INFO]

[INFO] --- maven-resources-plugin:3.0.2:testResources (default-testResources) @ MavenProjectThroughCommand ---

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] skip non existing resourceDirectory C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand\src\test\resources

[INFO]

[INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ MavenProjectThroughCommand ---

[INFO] Nothing to compile - all classes are up to date

[INFO]

[INFO] --- maven-surefire-plugin:2.22.1:test (default-test) @ MavenProjectThroughCommand ---

[INFO]

[INFO] -------------------------------------------------------

[INFO]  T E S T S

[INFO] -------------------------------------------------------

[INFO] Running com.birla.AndroidTest

Calling Android Test

[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.169 s - in com.birla.AndroidTest

[INFO] Running com.birla.AppTest

running maven test

[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 s - in com.birla.AppTest

[INFO] Running com.birla.MobileTest

Calling Mobile Test

[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s - in com.birla.MobileTest

[INFO]

[INFO] Results:

[INFO]

[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0

[INFO]

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

[INFO] Total time:  4.224 s

[INFO] Finished at: 2024-06-20T08:24:17+05:30

[INFO] ------------------------------------------------------------------------


Maven Basics for Automation Testing-2

 

Maven Project Creation:

Creating a Maven Project:

  1. Through Eclipse (Preferred):

    • File > New > Other > Search for 'maven' > Select 'Maven Project' > Next > Select 'Create simple project' > Next.
    • Enter GroupId (e.g., com.hcl) and ArtifactId (e.g., SampleMavenProject) > Finish.
  2. Through Command Prompt:

    • Use the following command to create a Maven project. Change the groupId and artifactId as needed.
      sh
      mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.4 -DinteractiveMode=false

    Example 1: Create Maven Project "MavenProjectThroughCommand"

    sh
    mvn archetype:generate -DgroupId=com.birla -DartifactId=MavenProjectThroughCommand -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.4 -DinteractiveMode=false

    Example 2: Create Maven Project "mavenProjectCmd2"

    sh
    mvn archetype:generate -DgroupId=com.birla -DartifactId=mavenProjectCmd2 -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.4 -DinteractiveMode=false

    Homework:

    • Create mavenProjectCmd3
    • Create mavenProjectCmd4

Check Maven Project Created in Specific Location:

  • Ensure the Maven project is created at the specified location: C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace

Verify Maven Project Creation:

  • Navigate to the project folder location:
    sh
    C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace
    • Check for the created project (e.g., MavenProjectThroughCommand) and its folder structure.
    • Verify the presence of POM.xml file.

Import Existing Maven Project in Eclipse:

  • Steps to import:
    • Right-click on the Project window > Import > Search for Maven Project (Existing Maven Projects) > Specify the root directory (e.g., C:\brahma\Practise\SelniumPractiseNew\Apr32023WorkSpace\SampleMavenProjectThruCommand2) > Select the pom.xml file > Finish.

Homework:

  • Refer to pom.xml to check for default JUnit dependencies.
  • Examine Maven project structure.
  • Add Maven dependencies in POM.xml for Apache POI, Log4j, and Extent Reports.

POM.xml File

The pom.xml file is where you define all dependencies, which Maven will download and add to your project automatically.

xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.hcl</groupId> <artifactId>SampleMavenProject</artifactId> <version>0.0.1-SNAPSHOT</version> <dependencies> <!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java --> <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-java</artifactId> <version>4.18.0</version> </dependency> </dependencies> </project>

Adding Dependencies:

  1. Selenium:

    xml
    <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-java</artifactId> <version>4.18.0</version> </dependency>
  2. Commons-IO:

    xml
    <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> <version>2.13.0</version> </dependency>
  3. TestNG:

    xml
    <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> <version>7.0.0</version> <scope>test</scope> </dependency>
  4. Apache POI:

    xml
    <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> <version>5.0.0</version> </dependency>
  5. WebDriverManager:

    xml
    <dependency> <groupId>io.github.bonigarcia</groupId> <artifactId>webdrivermanager</artifactId> <version>4.4.3</version> </dependency>
  6. Extent Reports:

    xml
    <dependency> <groupId>com.aventstack</groupId> <artifactId>extentreports</artifactId> <version>4.1.0</version> </dependency>
  7. Log4j:

    xml
    <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.17</version> </dependency>

Verifying Dependency Installation:

  • Check the "Maven Dependencies" folder in the project to ensure that the required JAR files have been added.
  • Check the local repository (e.g., C:\Users\Lenovo\.m2\repository) to verify the downloaded JAR files.

Integrating Maven with Eclipse:

  • Maven integrates easily with Eclipse through the installation of the Maven plugin.
  • Maven plugins, like the Maven Surefire Plugin, can be used to run testng.xml files and maintain a common project folder structure.

By using Maven, you streamline the process of managing dependencies and building your Java projects, ensuring a standardized approach and reducing manual efforts.

Creating a Maven Test:

  1. Create a Test Class:

    • Name the class ending with "Test".
    java
    package com.accenture; import static org.junit.Assert.assertTrue; import org.junit.Test; /** * Unit test for simple App. */ public class AppTest { /** * Rigorous Test :-) */ @Test public void shouldAnswerWithTrue() { System.out.println("My first Maven test"); assertTrue(true); } }
  2. Run Maven Test:

    • Right-click on the project > Run As > Maven Test.
    • Maven will run all test classes in src/test/java where the class name ends with "Test".
o/p:
---
[INFO] Scanning for projects...
[INFO] 
[INFO] ----------------< com.birla:MavenProjectThroughCommand >----------------
[INFO] Building MavenProjectThroughCommand 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ MavenProjectThroughCommand ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand\src\main\resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ MavenProjectThroughCommand ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand\target\classes
[INFO] 
[INFO] --- maven-resources-plugin:3.0.2:testResources (default-testResources) @ MavenProjectThroughCommand ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand\src\test\resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ MavenProjectThroughCommand ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand\target\test-classes
[INFO] 
[INFO] --- maven-surefire-plugin:2.22.1:test (default-test) @ MavenProjectThroughCommand ---
[INFO] 
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.birla.AppTest
running maven test
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.111 s - in com.birla.AppTest
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  6.150 s
[INFO] Finished at: 2024-06-19T08:21:15+05:30
[INFO] ------------------------------------------------------------------------


-----------------------
Create class = MobileTest :
----------------------------

package com.birla;

import static org.junit.Assert.assertTrue;

import org.junit.Test;

public class MobileTest 
{
@Test
    public void testA()
    {
  System.out.println("Calling Mobile Test");
           assertTrue( true );
    }


}



Run Mave test :
---------------
Right click on project >  run as "Maven tests"
When we run as maven tests >  it goes to "src/test/java"  folder > it runs all classes where class name ends with "Test"

o/p:
-----
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/brahma/seleniumSoftwares/eclipse-jee-2021-03-M2-win32-x86_64/eclipse/plugins/org.eclipse.m2e.maven.runtime.slf4j.simple_1.16.0.20200610-1735/jars/slf4j-simple-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [file:/C:/brahma/seleniumSoftwares/eclipse-jee-2021-03-M2-win32-x86_64/eclipse/configuration/org.eclipse.osgi/6/0/.cp/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/brahma/seleniumSoftwares/eclipse-jee-2021-03-M2-win32-x86_64/eclipse/plugins/org.eclipse.m2e.maven.runtime.slf4j.simple_1.16.0.20200610-1735/jars/slf4j-simple-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [file:/C:/brahma/seleniumSoftwares/eclipse-jee-2021-03-M2-win32-x86_64/eclipse/configuration/org.eclipse.osgi/6/0/.cp/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]
[INFO] Scanning for projects...
[INFO] 
[INFO] ----------------< com.birla:MavenProjectThroughCommand >----------------
[INFO] Building MavenProjectThroughCommand 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ MavenProjectThroughCommand ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand\src\main\resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ MavenProjectThroughCommand ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:3.0.2:testResources (default-testResources) @ MavenProjectThroughCommand ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand\src\test\resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ MavenProjectThroughCommand ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand\target\test-classes
[INFO] 
[INFO] --- maven-surefire-plugin:2.22.1:test (default-test) @ MavenProjectThroughCommand ---
[INFO] 
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.birla.AppTest
running maven test
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.097 s - in com.birla.AppTest
[INFO] Running com.birla.MobileTest
Calling Mobile Test
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s - in com.birla.MobileTest
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  5.137 s
[INFO] Finished at: 2024-06-19T08:25:32+05:30
[INFO] ------------------------------------------------------------------------


-----------------------------
Create class = AndroidTest :
-----------------------
package com.birla;

import static org.junit.Assert.assertTrue;

import org.junit.Test;

public class AndroidTest
{
@Test
    public void testB()
    {
  System.out.println("Calling Android Test");
        assertTrue( true );
    }

}


--------------------------------------
Run Maven tests :
------------------------
Right click on project >  run as "Maven tests"
When we run as maven tests >  it goes to "src/test/java"  folder > it runs all classes where class name ends with "Test"

o/p:
----
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/brahma/seleniumSoftwares/eclipse-jee-2021-03-M2-win32-x86_64/eclipse/plugins/org.eclipse.m2e.maven.runtime.slf4j.simple_1.16.0.20200610-1735/jars/slf4j-simple-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [file:/C:/brahma/seleniumSoftwares/eclipse-jee-2021-03-M2-win32-x86_64/eclipse/configuration/org.eclipse.osgi/6/0/.cp/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/brahma/seleniumSoftwares/eclipse-jee-2021-03-M2-win32-x86_64/eclipse/plugins/org.eclipse.m2e.maven.runtime.slf4j.simple_1.16.0.20200610-1735/jars/slf4j-simple-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [file:/C:/brahma/seleniumSoftwares/eclipse-jee-2021-03-M2-win32-x86_64/eclipse/configuration/org.eclipse.osgi/6/0/.cp/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]
[INFO] Scanning for projects...
[INFO] 
[INFO] ----------------< com.birla:MavenProjectThroughCommand >----------------
[INFO] Building MavenProjectThroughCommand 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ MavenProjectThroughCommand ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand\src\main\resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ MavenProjectThroughCommand ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:3.0.2:testResources (default-testResources) @ MavenProjectThroughCommand ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand\src\test\resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ MavenProjectThroughCommand ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 3 source files to C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand\target\test-classes
[INFO] 
[INFO] --- maven-surefire-plugin:2.22.1:test (default-test) @ MavenProjectThroughCommand ---
[INFO] 
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.birla.AndroidTest
Calling Android Test
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.173 s - in com.birla.AndroidTest
[INFO] Running com.birla.AppTest
running maven test
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 s - in com.birla.AppTest
[INFO] Running com.birla.MobileTest
Calling Mobile Test
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 s - in com.birla.MobileTest
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  5.626 s
[INFO] Finished at: 2024-06-19T08:29:43+05:30
[INFO] ------------------------------------------------------------------------


-------------------------------
Create class name  without Test : ios
--------------------------------
package com.birla;

import org.junit.Test;

 class ios //   this class will not get executed as Class name does end with Test
//class IOSTest  //   gets executed
// class IOS // this class will not get executed as Class name does end with 'Test'

// class IOStest //   does not get executed as class name does not end with "Test" 
// always Give Test,   but not 'test'
// class IOSTEST ////   does not get executed as class name does not end with "Test
 
{
@Test
public void testC()
{
System.out.println("hi IOS Test");


}




--------------------------------------
Run Maven tests :
------------------------
Right click on project >  run as "Maven tests"
When we run as maven tests >  it goes to "src/test/java"  folder > it runs all classes where class name ends with "Test"

console o/p:
--------------
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/brahma/seleniumSoftwares/eclipse-jee-2021-03-M2-win32-x86_64/eclipse/plugins/org.eclipse.m2e.maven.runtime.slf4j.simple_1.16.0.20200610-1735/jars/slf4j-simple-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [file:/C:/brahma/seleniumSoftwares/eclipse-jee-2021-03-M2-win32-x86_64/eclipse/configuration/org.eclipse.osgi/6/0/.cp/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/brahma/seleniumSoftwares/eclipse-jee-2021-03-M2-win32-x86_64/eclipse/plugins/org.eclipse.m2e.maven.runtime.slf4j.simple_1.16.0.20200610-1735/jars/slf4j-simple-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [file:/C:/brahma/seleniumSoftwares/eclipse-jee-2021-03-M2-win32-x86_64/eclipse/configuration/org.eclipse.osgi/6/0/.cp/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]
[INFO] Scanning for projects...
[INFO] 
[INFO] ----------------< com.birla:MavenProjectThroughCommand >----------------
[INFO] Building MavenProjectThroughCommand 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ MavenProjectThroughCommand ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand\src\main\resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ MavenProjectThroughCommand ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:3.0.2:testResources (default-testResources) @ MavenProjectThroughCommand ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\brahma\Practise\SelniumPractiseNew\March52024MyWorkspace\MavenProjectThroughCommand\src\test\resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ MavenProjectThroughCommand ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.22.1:test (default-test) @ MavenProjectThroughCommand ---
[INFO] 
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.birla.AndroidTest
Calling Android Test
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.148 s - in com.birla.AndroidTest
[INFO] Running com.birla.AppTest
running maven test
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.007 s - in com.birla.AppTest
[INFO] Running com.birla.MobileTest
Calling Mobile Test
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s - in com.birla.MobileTest
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  4.838 s
[INFO] Finished at: 2024-06-19T08:40:26+05:30
[INFO] ------------------------------------------------------------------------

***************************************************

HW Create Maven test classes in "src/test/java"  and run as maven test  as same as previous program?


git commands MCQ

 Here are some multiple-choice questions (MCQs) on Git commands relevant for Selenium: 1. Which Git command is used to clone a remote reposi...