so in a previous class uh so we have seen how we
can commit and push our project to your local and remote repositories so once our project is present
in our remote repositories then now so Jenkins is a tool which will automatically pull all the
files from the GitHub repository and then it will execute our automation so Jenkins is basically a
continuous integration Tool uh what is continuous integration means the development and testing so
these two teams working together and every day the developer will push their own code and every
night they will create a build from the in the devops environment and every day we will get the
new build from the devops so this Pro process will go like a cyclic nature so till we reach out
to the end of the testing cycle so we'll get a number of builds so similarly every day we have
to add some more test cases and we do some Chang in your automation so whenever you do some changes
immediately you have to make sure those changes should be part of your local repository and also
remote repository every day we have to commit and push our code to the remote repositories so this
process is called continuous integration process and similarly there is another process called
CD continuous delivery continuous integration continuous delivery or continuously deploy so what
is CD process means uh as soon as our testing is completed so development will go on like this
and parall the testing is also go on and once the testing is also done we will release the uh
some piece of code or piece of software to the customer and we'll deploy the software to the
customer and that is also continuously happen so that process is called continuous delivery
or continuous deployment so if you look at the devops if you just Google it in the devops you
will see this kind of picture let me show you okay just type uh devops you can see this kind of
a picture you can see so this picture is basically representing uh the entire devops process and
this is com combining of two processes one is CI process other one is a CD process so the
first part is called CI second part is called CD okay so if I look at this the picture will be
like this continuous integration and continuous delivery so so this is a process so this part is
called continuous integration this part is called continuous delivery or continuous deployment so
in this the testing and development in this the development and release so the process between the
testing and development is part of is called as a continuous integration process because developer
will continuously deploy the code and build the code and we will get that code and we will
conduct the testing so this this is a cyclic process and between the dev and release so every
time whenever you complete the testing we will release or deploy the product to the customer so
this process is also continuously happening as soon as the build is available successful build is
available or tested that build will be released to the customer environment or deploy into the
customer environment this called CD process continuous delivery so normally this process is
taken care by the uh re team re is nothing but release engineering team release engineering or
there is a separate team will be there to handle these kind of a processes and the ca process
mostly testing and developers will be involved and this particular CA process we can achieve using
Jenkins tool Jenkins is a tool through which we can automate the entire process so from the side
developer side they will integrate the code in the GitHub repository devop team will pull those
code and make the build and once the build is available at the other side the Jenkins will pull
our automation code from the Jenkins sry GitHub so for example let's say this is our jenin tool and
from the developers and from the testers in the last class I have shown you one picture so here
our GitHub repository and here uh the developer GitHub repository so every day the developer
push their code into the GitHub repository and then Jenkins will pull the code from the GitHub
repository and they will create a build and then package it and other side we also upload our
code in the GitHub repository push our GitHub repository jenin also will pull our automation
code and once the build is created and packaged then this automation whatever you uploaded the
test cases will be executed so here automation execution will happen so once our test cases are
passed here then build will be certified so this process will be done by the Jenkins itself in the
devops environment so that's the reason de Jenkins is owned by the devops team so we are not owners
of the Jenkins so in the Real Environment Jenkins will be installed on the devops machines and they
will share the URL to us so in the Jenkins there is an administrator and he is a main controller
of the entire Jenkins process and he will create multiple users in Jenkins and these users can
access their own projects they can create multiple projects in Jenkins so they can access their
own projects inside the Jenkins so they will provide us the URL uh because Jenkins is a web-
based application so with that URL we're able to access and we can log in and we can create our own
project related configuration so that is a part of us and rest of the things creating the build
packaging Runner automation certification these things will be done by the devops and to perform
these things also they will automatically done by writing some piece of code some automation skripts
they will write their own and those scripts will be executed inside the Jenkins itself so Jenkins
is a continuous integration tool and creating the build packaging it Runner automation certification
of the build this process is called pipeline okay build pipeline so pipeline in the sense let's say
this is our pipe the first part second part third part and fourth part so first here the coding will
happen and then after coding the build will be creation and after that we'll run automation that
means testing and then deploy so this process is called Jenkins pipeline so these type of pipelines
the devops will be created inside the Jenkins and every day this pipeline will automatically
execute so this is automated process based on the timel they will set so when the code should
be available when the build should be create triggered when the automation should run when the
deploy should be executed so these pipelines will be automated inside the Jenkins okay and this
is again the role of the devops people they can do that so our job is we need to make sure our
code is available in the GitHub repository and how Jenkins will pull the code GitHub repository
and then execute our automation so this particular configuration we have to done in our J so once
you get an access from the Jenkins so once we make available our code in the Jenkins then the
devop team will create the bu a pipeline like this and in the pipeline again the testing as well as
the development both will be combined because one side they will pull the code from the developer
code from the GitHub repository and build will be created the package will be created and then other
side they will pull our automation code from the GitHub repository then they will run automation
then certification will will be happen and once these activities are run then bill will be ready
in the next morning then we'll Again download the Bild in the testing and then we'll continue the
further testing because every day we will get get some piece of some features on our applications
some bug fixes in the build so we need to take care of all those things so this is called
pipeline so these type of pipelines we can create in genes by taking help of may one also okay these
are called May one goals and these May one goals can be achieved within your J Gins okay so this is
very high level process just to make you aware of these terminologies I'm just giving the brief idea
what is pipeline what is Jenkins what is CA what is CD and everything okay just have some knowledge
on these terminologies now we'll see how we can so most of the time sanity and regression test cases
will be executed inside the Jenkins itself because every day we will automate some more test cases
right so we always make sure those test cases will be part of the GitHub repository we will
run all the test case in the local environment first time and everything is pass within your
Eclipse then again we will run them to command B XML and then finally we push it to the GitHub
repository so GitHub repository most of the test cases are available not only sanity and Recreation
most of the test cases will be available so most of the automation will be executed at the time of
build creation itself so that tomorrow morning if I get any new build we will deploy the build in
the Q environment and then we will automate the new test cases and we will run those test case in
the local environment if they are executing fine then again we will push that new latest code
latest test case in the GitHub repository and again next today night the same test Cas will
be executed on the build so most of the time sanity regression uh main functional test will be
executed in Jenkins itself okay that's why we can there a lot of time will be reduced for us okay
in the local environment we'll try to automate new test cases execute one round in locally and then
push it to the GitHub so once you push it to the GitHub then jenin will take care of execution and
jenin will execute all the test cases seamlessly so headless mode It Will Follow by default because
in the devops environment the test cases will be executing mean they don't interested on the UI
flows and everything right but we are not we are interested on the UI flows and everything so we
always prefer the uh headed mode of testing but Jenkins by default follow headless mode
of testing because they not bother about UI flows and everything everything they will
execute backend and accordingly they can also reduce a lot of time so this is the process guys
okay now we'll see how we can execute our GitHub project inside the Jenkins and how we can install
Jenkins what are the configurations we have to do I'll go to step by step so listen very carefully
and you guys can do later so in yesterday uh we have all already pushed our project in the GitHub
repository so we need to have that URL first which is very important so once you have this URL so we
can run our project from anywhere because this is the global repository right so the global means
even you can also run my project from GitHub so if you have jenin install on your system you can
run a project from this URL anybody can run this project from your Jenkins tool which you have
installed on your local machines okay but this is a global fine so before uh running this project
in Jenis first of all we have to install the Jenkins so let us see the process of installation
of Jenkins and even in the Mac also it is the same process there is no difference we need to just
download one installer and execute it I'll show you so to download uh Jenkins what we need to do
is we need to go to the Jen official website you can just type Google download Jenkins and you can
just go to their official website this is this is also free and open source tool okay so go to their
uh Jenkins website and click on this download button and here you can see two sections weekly
relases stable LTS LTS is nothing but a long-term support so we always go with the long-term support
stable relases weekly relases they are not final bills actually they are keep adding the more
number of stuff so so here there are downloading Jenkins in this section you can see there are
so many flavors of Jenkins is there stalker kubernetes open to windows open Suzi there are
different environments Jenkins will be supported okay and these are uh these are not having long
time support so we are not going to prefer this the first section we are going to prefer this
again to install jenies there are two different ways one is we can have this generic Java package
one single jar file will be there we can download and whenever you want to run Jenkins on your local
system you can just run this warfel that's it when you run the warfel Jenkins will be ready and when
you stop running this warfel then Jenkins will be down so whenever you want to run or stop Jenkins
you can simply do this by using this war file for learning purpose this is very very useful but in
the real time environment they will download the installer file do executable file will be there
suppose if you're working on Windows and there will be one executable file and we'll download the
exe file and then we will install the Jenkins the installation process is same but the source is
different here we are trying to install using War file here we are trying to install using
uh installer file it can be Mac or it can be Linux or Windows or whatever but in all other
environments we use something called installer file and uh other Way by using War file but the
screens execution process installation process and everything is same but if it is an executable file
you have to just double click on executable file the installation process will start but if it is a
war file we need to manually run the vile through command prompt then the process will start but
once the process is started installation process is started the execution Parts like installation
steps screens navigation everything is exactly the same and one more different is when I use War
file uh the command is running in the command prompt so we need to minimize this command promt
so your Jen is keep and up and running so once your job is completed in Jenkins once your tasks
are completed in Jenkins then you can stop the Jenkins by stopping the war file so always we can
start and stop this war file so that you can have complete control on Jenkins whereas if it is a
executable files your Jenkins is always up and running so you need you know need to stop and you
to start the Jenkins every time this is always up and running so whenever you need a Jenkins you
can work your other differences in the warfel because this warfel is provided only for learning
purpose so when I executing my test cases in the Jenkins by default it will follow the headed
mode execution because this is provided for learning purpose we can see all the screens
uis navigation and everything on the execution but when you install the when I install Jenkins
through install either Windows Mac or anywhere we cannot see the UI so by default they will follow
headless mode of testing so without having any UI flows and everything the test cases will be
executed at the back end so these are the major differences but the way of working is exactly
the same internal once you log into the Jenkins project configuration execution everything is same
there is no much difference only the installation is a difference so we will go with the generic
Java package page because we are learning it but in the real time you won't install any Jenkins may
all these things okay in the real time the devop team they will own this particular jenin software
they will install in their environment they will provide the access to you just you need to access
it but you don't need to install anything on your local systems okay fine now we need to download
this war file once you click on this war for the first one it will automatically download a
single War file so war is nothing but a we web archiving files web archiving this is basically
web application right it is bundled everything into one single file so if I just go back to
the download section I have already downloaded the v file if I look at here this is a my file
jenkins. so once you downloaded this war file you can just keep this war file somewhere in the
C drive D drive or wherever you want don't keep inside the downloads itself because sometimes
we may delete the files from the download right once you download it don't keep it here copy
the file somewhere so I have already copied some file in the automation project here here you can
see my file is there so jenkins. War so this is a first step so whatever the war file we have
downloaded we have to keep that war file inside the one folder and then we have to run this vfile
so first time when you run the vfile you need to do all the configurations installation process
and everything but second time when you run vfl it will r not ask anything I will show you so first
time when you run the vfile so I have captured all the screenshot step by step just follow the same
process this is the latest version of Jenkins I've just captured the latest screens okay so this is
my War file and once you downloaded this varel so we need to open the command prompt just like this
and if you're working on Mac open the terminal and uh this is the command prompt and wherever
the v file is got copied you need to go to that location so for example uh I copied my vfile here
so I'm just opening my command prompt I just type CMD it will directly open the command prom if
I say LS or di it will show you jenkins. v file so wherever the v file is present in the same
location we have to run the command what is a command whenever you want to run the jar file the
command is same Java Ian jar and then in jenkins. previously also we have run multiple jar files
have you remember which jarfile we have run it can be vfel or Jarel these are all Java files
only so whenever you want to run Java files we use this command Java Ian jar earlier also we have
used multiple times have you remember when we have used this command Java Ian jar jin. far and this
command Java ifar yes whenever you start selum grid Standalone server that is also jar file right
we have downloaded this one this one celum server jar so to run this jar file also we use Java Ian
jar command so whenever you want to run VAR files or jar files we use Java I jar that is a command
remember this okay so once you run this command it will start the installation process now once
you run the jar file so it will go through some statements like this and in the same statements
you need to identify uh something called password so this is a password you can see here I captured
separate screen so this is a admin password you need to copy this password somewhere some notepad
or somewhere because later we will use this to unlock the Jenkins because by default Jenkins will
come with some authentication so before installing the Jenkins we need to unlock the Jenkins for
that we use we need this password and suppose if you forgot to copy this password you can find
the password in this location default location is provided so once you run this command jenkins. it
will go through some process and here we will see this Jenkins initial setup is required and admin
user has been created and password generated and here completed initialization so you will get
these screens okay and then you need to copy this password somewhere and you need to minimize
this command prom you should not close and in the same screen finally you can see one message called
Jenkins is fully up and running you need to wait till you get this message in the command prompt
and also you need to copy this password so once you get this message Jenkins is fully up and
running you need to minimize this particular window just like this just minimize this window
don't close this window and then proceed further steps so once you minimize this window by default
Jenkins will run on Local Host 8080 port number so once you open this port number 8080 Local
Host colon 8080 then you will see the unlock Jenkins screen so whatever password we have
already captured in the previous step from the command prompt just you need to provide the
same password Here suppose if you forgot to copy this password in the command prompt you can just
go to this location here red color it will show you the location go to there and then copy this
admin password so this admin password will work only once to unlock the Jenkins because we will
unlock the jenies only once later we will create admin account user accounts and so on so once
you provided administrator account click on the continue so once you unlock the Jenkins then it
will show you another screen like this customize Jenkins so here by default it will install some
suggested plugin because Jenkins will come up with some plugins additional plugins we require
to work with the different softwares so by default select this one install suggested plugins and the
in later on if you need any additional plugins are required we will try to install Okay because
Jenkins alone is not directly supporting git GitHub may1 all these tools so there are internal
plugins will be there so those plugins we have to install so install suggested plugin once you click
on and then then it will start the process so you need to wait all these boxes are completed so here
folders are completed similarly all these blockes will be completed it will take 2 to 3 minutes of
time so to finish this particular process Once you turn all the boxes into green then it will
automatically move to the next screen here it will ask you to create an administrator user and
here provide everything as an admin I provided everything as admin password is admin confirm
password admin and you can provide some Dum email email ID also it's not not a big thing so you can
provide all administrator and you need to remember this because this is a main user for the Jenkins
and he is able to create another users or another accounts in jenin in future so he's an admin
account so then click on the save and continue and once you have done it and then it will start
another scheme and instance configuration they will give you the url jenin url so by using this
URL we will able to access the jenin every time just copy this URL somewhere so whenever you want
to access the Jenkins use this URL on the browser then simply click on Save and finish so once you
have done it you will see the final screen called Jenkins is ready so this is how we can install the
Jenkins so once the Jenkins is ready then you can open this URL Local Host colon 8080 on the browser
and you will able to see the dashboard page okay so till here I have already done so let let me
show you my Jenkins dashboard so Local Host colon 808 So currently my Jenkins is not running because
I have not run this Command right whenever you run this command then only Jenkins will start but only
the first time you need to do all these process every time you don't need to do okay so once the
Jenkins is up and ready and if you if you close this window then Jenkins will stop running again
tomorrow if you want to run the Jenkins again open the command prompt and run this command so second
time I'm running this command second time it will not give you any password or anything it will
directly start the Jenkins because I already completed my installation so you can see started
initialization listing all the plugins you need to wait till uh you get this message jenin is fully
up and running so you can minimize it now we can see the URL go to Local Host 8080 now my Jenkins
is started so I will get a Jenkins log page okay suppose if you close this window my Jenkins will
automatically stop so that's the reason you need to keep open this box o Open like this and then
I'm logging to my Jenkins admin admin and then click on the sign in so when you select this
checkbox it will always keep in sign in every time it will not ask you the signin process so I
just clicking on sign in so once you're clicking on sign in it will go to the dashboard page now we
can see this is my dashboard jenin Dash dashboard currently I don't have any projects running in
this Jenkins okay so this is a screen you can see like this so this is the installation part till
now we have done installation and if you close this command prompt automatically Jenkins will
stop running so we should not close this suppose if your work is done in your Jenkins and your
task is completed then you can close this command prompt automatically jenin also will be stopping
so whenever you need Jenkins open the command prompt run the command and whenever you stop
Jenkins just close the command prompt your Jenkins will be automatically stalled so this is a ways
we can simply install Jenkins through War file okay so once you have installed Jenkins then we
need to do some configurations to run our GitHub project or not only GitHub any Java project we
want to run in jenas we need to do some additional configuration only one time configurations we have
to do so what are the configurations we have to do is so if you go back to the manage Jenkins go back
to the manage Jenkins all the configurations of Jenkins we can do from the manage Jenkins options
so in this you can find something called plugins okay plugins you can see so what it is saying add
uh remove disable enable plugins that extended the functionality of the Jenkins suppose if you
want to work with with some third party tools for example I want to work with the MAV or G GitHub
so these are all external plugins some plugins by default we'll get from the Jenkins installation
itself and some plugins we have to install manually okay so for example what are the plugins
we required is we need Mayan plugin we need git plug-in we need GitHub plugin so these are the
plugins we required in Jenkins so if it is already available no problem if it is not available we
have to inst manually so that's the first step we need to do so if I go back to the plugins here and
you can see multiple sections available plugins installed plugins if I go back to the installed
plugins it will show you waterall plugins are already installed so let us cross check suppose
if you type uh git now we can see G client plugin is already installed get plugin GI Hub related
plugins so you can see all git and GitHub related plugins they are already installed okay no problem
at all now if I look at Mayan mvn Mayan so Mayan integration plugin is also successfully installed
and suppose Mayan integration plugin by default you will not get only G GitHub related plugins
you will get so in that case what you need to do is you need to go to available plugins and
here you need to search like for example I'm SE searching for may1 so when you search for may1
here you're not getting any may1 related plugin you will get one thing release plugin May One
release plugin but we don't need actually and uh whatever plugin just now have shown you that
plugin will not be there at the beginning so if I go back to install plugins and again because this
plugin additionally have already installed May one integration plugin is required so if I look at
in available plugin so may one integration if I search for this you will not get it here this you
will get something else but this plugin May inte creation you will not get why because I already
installed this plugin so that is appearing in install plugin section if it is already installed
here it will not come but if it is not installed then the M integration plugin will show here then
you need to select the checkbox like this and you need to install it so may1 integration plugin
is required so how we can install I have shown you here so install Mayan plug-in how we can do
that we need to go to Mayan Jenkins manage Jenkins and from there go to the under system
configuration go to plugin section and inside the plug-in section and if I look at here
the screen is visible everyone somehow it is blur but okay still that's fine under available plugins
you need to search for Mayan here you can see Mayan integration plugin so select the checkbox
and click on install this is only one time job okay once you newly installed Jenkins you need
to install the Mayan plugin so once once you have installed and then it will start downloading
the may1 integration plugin it will take few seconds and after that plugin will be installed
so this is the one thing we need to do so may one integration have done with the Jenkins the next
part is once the uh once you install that will comes under installed plugin section in install
plugin section if you select may you will see May integration plugin so this is the only additional
plugin we required but get GitHub plugins are already available in the J itself okay now so once
you have this plug-in install additional plugin again go back to the dashboard so we need to do
some uh configuration some more additional class apart from the installation of plugin we need to
do some more additional configuration in that we have to specify the Java location mavan location
and git location because Java Mayan git these three softwares require to run our automation
projects right but Jenkins don't know about these three Jenkins will not come along with these
three so we have already installed Mayan Java and get in our local system so we need to provide
those paths inside the Jenkins so that Jenkins will run our automation using those softwares and
paths we need to specify where we have to specify the paths this is also onetime configuration
manage Den is again go to manage Jenkins and once you go to manage Jenkins and when we have to
do this once you install may1 plugin then we have to specify the path go to manage Jenkins and here
we can see something called uh tools okay tools so click on the tools so once you click on the tools
okay and here you can see the tool section you can see multiple section May one configuration
okay so uh I think not this one just a second tools or systems let me remember so manage Jenkins
okay under system configuration yes we need to go to the tools under Tools we need to provide three
paths jdk G add Mayan so these are two sections we need to take care so first go to the manage
Jenkins and once you go to manage Jenkins go to the tools and once you go to the tools and may1
configuration jdk installation G installation and may1 installation here it is we don't need to
do anything in the may1 configuration here so directly go to jdk installations so in the jdk
installation if you expand this by default you will get this button you need to click on ADD
jdk first time and then you will see the you can provide some name here your jdk name and here
jdk path your Java path where you have installed Java in your local system I have installed Java
on my C drive program files Java jdk so this is the path you need to copy till the home folder
copy this path just provideed here so this is the jdk configuration now scroll down here also
under the git installation you provide the name of the git you can provide any name here this is
us user defined name and provide the path to get executable means you need to provide executable
file also so we already installed git last time right so go to the C drive and under program
files you can see git and here under bin folder you can see git.exe file so you need to copy this
location and put that so this is gitar now scroll down here go to MAV installations and go to here
add May one because this box you will get once you click on ADD May one because I already clicked
on earlier so I got a box and there are multiple buttons it will show you only one MAV is enough
okay so provide some name here and provide the MAV so in the yesterday I have already installed May
one right so where it is in the C drive uh think in the program files where I have kept here it is
so this is a b one home path till here you need to provide the path so once you provided these paths
in this Mayan configuration and tool section just select a save and apply okay this is again one
time job add jdk add git add me so three things we have successfully configured so now once
we have done it we are we are able to see the entire screen this is full screen actually here I
have copied uh I think screen is very smaller so here this is jdk path git path and Mayan path so
these are mandatorily we have to specify because Jenkins will use these three softwares to run
our automation so and then we can click on Save and our job is done so once you installed J two
additional steps we have done one is we need to integrate Mayan plugin and that we can do from
manage Jenkins and a plugin section after that we need to specify the paths where you have to
specify again in the same manage junkins and the tool section we need to specify the path so go
to the tools it will show you this window jdk installation and uh git installation here and then
Mayan installation so these are the tools we are going to use so once you have done it now again
go back to the dashboard so now we are ready to run our project so how to run our project GitHub
project so GitHub project is what basically it's a May project only right whatever project we have
uploaded in the GitHub we pushed in the GitHub that's a mavan project so now what we need to do
is just select the new item so till now what we have done is we have installed Jenkins and we have
installed required plugin we have set up all the paths now Jenkins is ready so this is one time job
so once you have done it and you can create a new item and here there are different type of projects
you can see and in the GitHub we have pushed May one project so we need to select the Mayan project
here before providing give some name here so I'm giving some name open card project you can give
any name okay some project name is required then I'm taking Mayan project I'm selecting this may
project because in the GitHub we uploaded May one project and then click on okay button so once you
have done it so it will go to configuration page this is our configuration page this is uh specific
item configuration page in this General section if you want to write some description about
the project you can write it or else you can leave it now directly come to this source code
management section in that source code manage agement section select git software git and here
you have to provide the URL of your GitHub project so this is the URL of the GitHub project that
we need to provide so we don't need to provide any credits nothing okay so just provide the URL
that's it and select under source code management select the git and provide the URL that's gone
so that red color error will be gone so you don't need to provide any credentials just provide the
UR URL that's it get selected and provided the url repositor url and now come down directly
no need to select anything by default it will execute everything from the master Manch and uh
scroll down directly to the Bild section and in the Bild section p. XML by default you can see and
to run p. XML what is the command we have executed in the command prompt have you remember to run the
pomet XML file through command prompt which one what is the command we have executed mvn test
mvn test so the same command we have to specify test mvn is not required because by default
it's a Mayan command jenin will know that so the goal and options is test test is a command
may1 command and this command will execute the pom.xml pom.xml will internally execute the test
engine. XML test engine. XML will execute all the test cases so once you provided and if you scroll
down here you can see email notification so if I select this you need to provide all the recipents
whoever want to receive a email like the execution is successful or passed if you want to know that
you can provide all the email addresses group of email addresses otherwise you can just unlock
this and then click on apply and save only two sections guys so we need to just select the git
and provide the URL and scroll down and directly go to the build section pom.xml by default will
be there and execute this command test and then apply and then save so once you have done it now
you are in the current project uh dashboard this is Project Specific dashboard and if you go back
to the main dashboard here we can see one entry so this project is so far we just created a new
item here okay and if I look at here three dots are representing not built means we still not
executed this project so not build is there because we have not executed this part and this is
the main dashboard and whatever items you created multiple items multiple projects you created
you can see multiple items in the list here okay and if you click on this project it will go
to the Project Specific dashboard and from here we can start running the project so how to run the
project here simply you can click on build now so once you click on build now Jenkins will pull
the code from the GitHub repository that will take few seconds of time and once you pull the code
from the GI repository it will start execution and the execution status console locks everything
we can see in the Jenkin itself now just observe how I'm executing the test so click on the build
now once you click on it in the bottom here build history you can see one progress bar right and
if you click on on this progress progress bar it will show you console output so here you can see
whether you're are able to pull the project and execution is started or not you can see that
so it is started pulling the project and you can ignore all the warnings so it is started
executing the test it is pulling the project first it will take few seconds of time so once
the project is pulled from the GitHub repository then it will start execution so now we can see
test running suit so War file will by default follow the headed mode execution only so we're
able to see all the screens and everything but if you really install the jenkings on the real
time you won't see any screens everything will be executed at the back end itself so this is another
test case which is executing so through Jenkins we are executing the remote project which is pul
pushed into the GitHub reposit now my test case are got pass I got a report okay so this is how we
can run G Hub project inside the J case now again if you go back to the main dashboard see here you
can see tick mark earlier you can see only three dots and suppose if it is got failed you will see
the cross button here red color ball you can see if it is a past you can see the tick mark success
if it is not executed still you can see the three dot you can run this project any number of times
any number of times you can run this project okay again if you click on the project it will go
to Project Specific dashboard and this is is my previous run you can run any number of times
okay if you click on this link it will show you the when it is executed who is executed which
repositories got executed so all the information it will clearly show you okay so if you want
to see the console output if any failures are happen you need to go to console output identify
the failures again do modification of the code again you have to commit and push and again come
back and execute so this is one time setup so once you have configured your project Jen Cas your
job is done in case in future if any test cases are got failed in Jenkins then you need to figure
out so you need to first check your test case are execute in your local system in Eclipse if it is
working again modify the code and uh commit and push the code in the GitHub repository and again
one more round execute in Jenkins and then it will be fixed so that's how we can fix it okay so this
is how we can run the projects within your jeng this is the process we followed in the normally in
the realtime environment we always run the remote projects in Jes suppose I don't have a GitHub
account I have project in my local system can we execute directly in J Cas can we execute my
local project suppose my project is already there in my Eclipse I go back to my Eclipse I already
have my project in my Eclipse I want to directly run my local project in my Jenkins not in the
GitHub repository yes that is also possible so I will show you how we can run our local project
in our Jing so this is my project right so this project I want to execute so in this if you go to
master. XML file so I have mentioned I have added some more test cases yesterday I will show you
uh for now I'm just commenting these test cases okay so I'm just trying to run these two test
cases and also where I want to run go to your uh configurations test resources configurations I
just want to run on my local system so comment this and this is a URL I want to use okay so now I
want to run my local project in my Jenkins Master XML I want to run so go to P XML here I put Master
XML okay so now I want to run my local project inside my Jenkins how we can run so we already
created run. B file earlier right if I open this run. B file so these are the two commands we have
already given so if you run the bat file it will directly run the PED XML or not yes so now we need
to run this do bad file inside the J gin so how we can do this there are multiple ways we can do I'll
show you so go to the new item again select the May one project okay this is open card score local
project and select the mayavan project one more time and click on okay and now again configuration
section here we can write description or it leave it so here what we need to do is we know don't
select any source code management or anything so directly go to the build section so here provide
the pal location pal location so where is our pal in our project so go to your eclipse and get the
location of the pal go to properties and provide the full path of the pal okay so go back to your
Jenkins full path of the P okay now command is same test that's it you can apply save now we can
run this project so click on will now now this time it is running my local project so click on
this uh progress bar now we can see the entries so this is my workspace my project is currently run
so you can also run your local project inside your chines this is also onetime configuration
so now it is started executing my test cases but most of the times we don't
run local projects if you want to run your local project directly you can run in
Eclipse right why we need Jenkins tool not required right so perfectly working fine okay suppose uh yeah build is successful now
if I go back to the main dashboard you can see another entry so open cut local project
is also successfully executed suppose I want to run project through run. b files we already
created run. file so there is another way to create so I'm creating one more new item so this
time I'll select freestyle project okay this time I'll select a freestyle project so freestyle
project is a common for all kinds of projects May grid Mayan and there is another tool is there
in the market uh which is called basically uh I forgot the name uh Grid or something not grid so
let me GD yeah so gridle is another tool which is there in the market which is competitor of May one
so if I select the freestyle project is applicable for all so let me execute so this is again open
card I'm executing using bad file okay so I can say bad file now this time I'm selecting the
freestyle project when executing through bad file you need to select the freestyle project not
May project select the freestyle project I say okay now again configuration page in this so what
you need to do is directly don't select any source code management or anything just directly come to
the build step build section here okay and in this in the build steps section you need to select this
drop down and here you can see multiple options and here you need to select Windows uh execute
Windows batch command and if you're working on Mac you have to select execute shell command so this
is the option you have to select if you're working on Mac and in Windows you need to select this
one execute Windows batch command and then here you need to provide the location where exactly
your bad file is located so what you need to do is you need to go to the project again copy the
location of your run.bat file go to properties get the location that's it copy this go back and then
specify okay or else you can do you can run two commands actually CD first you need to go to this
location project location and then you need to run the run. B file so first this command will go to
the project location in that project location run. B file is there okay for example in the r that bat
file itself we configured this location right so we don't need this you can just type the run.bat
and again we have to specify where is run.bat file is present so we need to provide the path of
run.bat file inside the run. B file again path is there everything is configured that's it so just
apply and save and now go to the build now so this time your project will be executed only through
run. B file so click on this progress bar so now we can see it is started my test so these
are multiple ways to run our project inside a eclipse so we prefer always run
GitHub project using Mayan inside the jenin okay perfectly fine so now we have
seen three different ways to run our project inside the Jenkins now in the real time
which one we will prefer and why so for example let me show you something this is
most important scenario try to understand this yeah freestyle is just for demo purpose
okay we never use it most of the times yeah look at this in the real time environment in the
real time environment I said devops will own the Jenkins application right so let's say this
is my devops and this is my devops server and in the devop server here my Jenkins is running
Jenkin application is running okay my this is my testing environment and this is my eclipse
is my local environment and this is my local system okay this is my local system okay now I'll
access the Jenkins into my local system right so access I'll access the Jenkins using URL because
this is a web application so now I'm running I'm accessing the Jenkins in my browser locally so
in this particular Jenkins can we run the local project in this Jenkins can we run the local
project directly using freestyle project or mayavan project whatever can we run it so we are
accessing this Jenkins from the devops machine devops system or this is different machine totally
and in this jenin can we run our local project or not no why why we cannot run two reasons
one is inside the Jenkins whatever Java path mavan path git path we set right in
the configuration those paths are referring devops system so in the devops system G jdk
everything will be installed those paths only recognized by jenin in the remote jenin we
cannot specify the local paths in the remote Jenkins application we cannot specify the local
paths that is not valid that will not identify in Jenkins remote Jenkins application the paths
also should be from the remote system itself okay so that's the reason we cannot run our local
projects inside remote Jenkins so GitHub is a remote application using this URL we can run
the project inside the Jenkins but why we are able to run our project in Jenkins now local
project because Jenkins is also installed on my local system right my project is there in
local system Jenkins also there in my local system so Jenkins can easily recognize my local
paths jdk path git path mavan path okay project path everything is able to recognize because
Jenkins also have installed my local system so that it is possible but in the real time Jenkins
will be in different system so in that you can conf you cannot configure the local pass so that
you cannot execute your local project inside the Jen if you still want to execute you have to
push your project to GitHub repository then get the URL and execute in checke so now everybody
is clear on this please confirm in the chart box so everybody please confirm in the chart box I cleared about Jenkins so this
is a simple way we can use a Jenkins okay so all the skines I have
provided so how to run our project so you can just how to run GitHub M project in select the
new item provide the name select the M project and go to source code management select the git
provide the URL and in formed XML test command save and apply then go to build now and execution
will happen so build will be successful so every screenshot is captured step by step you can
just go through this and you can do one round of practice so that's it about the Jenkins so if you
learn the devops or if you join in devops course in future somewhere so you can learn in depth of
Jenkins and may because they will teach you how we can create the entire pipelines and how we can
organize and how we can control and administrate Jenkins and get GitHub everything you will learn
in depth but for now for testing prospective this much is enough just you need to configure
your project in the Jus and that will keep itun okay if it is a normal Java project you can go
with the freestyle project you can select the freestyle project and then you can ex you don't
take the mavan project so in Eclipse instead of MAV project if I have a normal Java project
for example if you want to run that project you can directly go to freest style project and
then execute but we don't do like this normal Java projects we don't run even Java developers
also create a Mayon project so for development purpose they will create a May project because
they also need lot of dependencies so they will add all the dependencies form. XML they can do
it but if you use normal Java project you need to manually add all the dependencies and
everything so even developers also don't create normal Java projects so normal Java
project is only for learning purpose but not for the realtime projects the projects
we can create always May one project okay so this is all about uh May one project so can go
through this screenshot I can just try one round of practice once you have upload suppose if still
not uploaded your project to the GitHub repository you can use this URL so I already uploaded right
so install your Jenkins in your system do all the configurations required configurations and run
this project so you can also run my project if you if your project is having any some issues
still not completed still that is fine you can run this URL in your local Jenkins application it
will work but configurations you have to do very carefully that is most important okay so now
go to your project so I have added some more test cases I will leave it to you you guys can
explore so I have added some more page object classes you can see here uh search page shopping
card page checkout page I have added three page object classes additionally also I have added
three more test cases uh one is search product test case this is for searching the product in
our application and this is adding product to the cart that is another functionality I have
added another test case and this is end to end test case so end to end test case is nothing
but uh so this is first everything it will do from the beginning account registration first
and then after account registration with the same email ID it will log to application and after
successfully login it will search and add product to the cart and then it will go to shopping card
and then it will put the it will do the checkout product process and finally it will capture the
total price and we do the validation and payment options are not available here email sending and
payment options not available because there's the demo applications so this piece of code will
not work I have just commented this but till here everything will work and that to this will
work only on your local application if you install open cut application on your local system using
examp so this code will work properly shopping card checkout process will work but uh the real
application it will not work okay so have this if you have already installed local application
you can run this otherwise you can leave it no problem end to end test case I'm talking but
rest of the two add to card and search product so these two things will work in any application
okay and added those test cases in all XML so this is Master XML I have added all the test cases here
and one XML file for grouping testing so here this XML file control the grouping I also added all
the test cases in whichever group you want you can add it and this is for G Standalone XML file
if you want to run your test case in the local grid environment you can use this XML file and if
you want to execute test case on the docker grid then you have to use another XML file G doer. XML
file so for multiple purposes we created multiple XML files and whichever XML file you want to run
put that XML file in the pomed XML here and then start execution so this is a complete project I
have added few more test cases I will share this entire project today complete project I will
jip it and store it I'll upload in the Google Drive you can get it from here okay so this is
all about hybrid Ren framework I'm not going to push this project in the GitHub repository I
will share in the Google Drive you can get it from there you can download and you can Import
in your Eclipse you can work on it and GitHub repository we already pushed yesterday code right
so the basic two test cases already there in the GitHub repository and uh this is a final project
final uh project and also you can see everything page object classes test based class test cases
utility classes resources files okay and then log files reports screenshots everything you can
see right so Docker compost this is for dock all the commands I put in one text file you can
see here so to run the Standalone grid you can execute these two commands first you need to go to
your project location then execute this command it will start your local grid environment also the
servers. jar file also I kept inside the project so you don't need to refer anywhere else and grid
Docker if you want to start grid Docker go to this location and execute this command so this command
will internally use Docker composer AML file and to stop the grid containers you can execute this
command okay to run the pomed XML in the command command prom you can execute this may one command
all the commands I put in one single text file you can easily refer that but when you run your test
cases remotely you need to carefully check the configuration file suppose if you want to run my
grid environment first thing is what you need to check this part is remote or not and the second
thing is what you need to provide the global URL not the Local Host URL and the next thing is we
need to go to the XML file and you can put the on which environment you want to execute so then
execute it that's it so everything is available the only thing is you need to keep adding more
number of test cases I have already shared Excel sheet earlier there are so many n number of test
cases are there from each sheet take one single test case and try to automate so if required
add more number of page object classes and add more number of test cases so I have added few
test cases here similarly you guys also can add more number of test cases and just just execute
add XML file in P XML then execute that's it so this is a hybrid driven framework for selenium
web driver okay so with this we have finished this entire framework so in this particular
session especially have added this part so in the previous sessions I have not covered this
part grid environment and everything so even uh Docker if not covered grid is not covered but
this is newly added in this framework so that's the reason it take another two more sessions on
the framework concept okay so I'll share all the document yesterday already shared and today
I will share this entire project full-fledged project you can keep it with you and then you can
execute okay so I'll stop here for today's session and from the next session we will start Kumar
part if you have any questions we will discuss