0% found this document useful (0 votes)
14 views

Git Hub

Uploaded by

siddu1008patil
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Git Hub

Uploaded by

siddu1008patil
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

GitHub:Github is de-centralised cloud repository where we can maintain our entire

framework in one place .so that it can be shared easily with multiple engineers
working on the same project in different location.

Advantages:

1.De-centralised repository

2.cloud repository

3.No need of system engineer to maintain github

4.File sharing between the team members will be easier

5.Highly secured and we can have the back up any time.

6.Master copy of the frame work available in github,so that we can perform batch
execution any time easily.

There are two type of software available in git

1>GitHUb--server

2)Git client
a.git desktop

b.git bash

c.git Gui

d.E-git
Q. How to store existing Project (Framework) in to Git? (How Frame work
developer put the frame work in Github for the first time)

 1.Select the project Right Click


Select Team -> share project -> click
2.Click on Create(Create new local repository -> give any folder -> for first time) &
click on finish and Finish(In configure window)

3. Status of the project will be [No Head].-> It is present in working directory.(Local
repo is created but not yet commited)

Q. How to transfer the framework from working directory to local repository.


(How to commit)

 Select the project ->Right click->Team and -> click on commit


[On Git Staging changes]
Select & drag from unstaging changes  to  staged changes & enter the commit
message and click on commit ( from Git staging window)
 Status of the project now becomes to master it is present in local
repository(means Commited).

Q. How to transfer the framework from local repository to Git hub(Global


Repository).

 Select the project [right click]  team  push brand master click
 provide  github 'url' & UN & PW  click on check box ‘store in secure Store
click on next click on force over right check box then click next -next -next(ok) &
finish .

Q. How to get the framework from github global rep to Local System(importing
or cloning)

How to get the framework from github global repository to local system
go to eclipse  file  import  click & expand git folder  select & click project
from git  next  select on clone URI and click next
 provide git url,un & password  click on next,and next.(by default master will be
selected in the checkbox)click next(local repository folder name will be choosen by
the syatem by default)next and .finish.
<<A HREF>>

== ==

Maven

It is a popular open source build creating and testing tool used by developers and
automation test engineers.

Mavan usage in development:


 In case of development maven will be used to test the application build, when
multiple developers working in the same application.
 If one developer modify the source code of the module 1, it might effect other
modules. So that maven will be used for build testing and for build creation
Maven Usage in automation:
It is used to test the framework build, when ever multiple automation engineer
working on the same framework. When one automation engineer modify the library it
might effect other components of the framework, so that we go for Maven to identify
such kind of issues.

Maven Folder Structure:


https://mvnrepository.com/

How to handle Dependency in Maven :

Dependency is a feature available in Maven which is used to connect global repository automatically and download all
the jars into local repository and eclipse project as well.

In order to handle dependency go to pom.xml file inside maven project and write dependency code for all the jars like
TestNG,WebDriver,apache Poi and surefire plugin for running testing.xml inside pom.xml file

== ==
<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
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>Elf</groupId>
<artifactId>Elf</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>

<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.141.59</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.14.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.17</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.7</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.21.0</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>testng.xml</suiteXmlFile>

</suiteXmlFiles>
</configuration>
</plugin>
</plugins>
</build>

</project>

Maven command Line Pulgin: It is a plugin which is used to handle maven project in command line.

In order to handle maven project in command line ,we should follow maven build life cycle.

mvn clean clean/delete the older report

mvn validate validate the project and download the all the jar (dependency)

mvn compilecheck the compilation issue in the framework

mvn test Execute all the tests.

Installation steps of Maven command line plugin :

Go to google & search for download Maven

Click on first link navigate to Maven community

Click on apache-Maven-3.6.3-bin-zip

Download the zip file & unzip the file

Set the Path of Maven as shown below (2 types of path should be set)
Go inside the folder & copy the bin location (including the bin) c:\Selenium.ocmm-32\apache-maven-3.6.1\bin>

Go to local system environment variable window -edit the “path” in system variable & paste the location of the apache
Maven bin folder ‘;’ after this

Inside ->User variable

M2_HOME=c:\selenium_OCCM_32\apache-maven-3.6.1 --------------excluding bin

JAVA-HOME=c:\programfiles\Java\Jdk1.8.0-51

NOTE: In order to check Maven installation ->go to command line &check (Type) mvn -Version .

In order to execute go to the location where pom.xml is present and open the command prompt and type mvn test for
executing all the test case.

EX : E:\sandeep\eclipse-workspace\seleniumExp\Actitime1>mvn test

== ==

Jenkins :(Continous Integration/Continous Development Tool)


==============================================================

Jenkins is a popular Open Sources CI & CD Tool which is used by developer & Automation test Engineers.

-> In case of developement Jenkins will be used to continuos developement - It means whenever developement
of source code is completed Jenkins automatically get the source code from the github & create a build, then
install the build in testing environment,staging and production environment automatically..

jenkins Usage in Automation:-

In case of automation Jenkin will be used for continous integration, It means jenkins continuosly monitors the
build (Framewrork)in git Location. Then Automatically starts the execution based on configuration of the
Jenkins(or whenever there is change ).

->Jenkins provide 3 level of Excecution

i)On demand execute whenever it is required(based on the need)

ii)On Schedule execute based on Time scheduled by you

iii) Pole SCM execute based on keeps on monitor the git or build

(means Monitors the build in Github then automatically executes whenever there is a change in the framework).

(Ie starts execution whenever new build arrived)

Advantage of Jenkins-->
i)Monitor the build system or is location then execute testscripts- When ever New Build or arrive & send out the
email Notification.

ii)Monitors the build in Git Location then send out an email if build fails(if modification,addition,deletion done)

iii)Jenkins Provide email Notification

iv)Jenkins Provide 3 level of execution

v)We can execute the build in any system

===================================================
Steps to install Jenkins:-

1)Go to google search for jenkins

2)click on first link to navigate jenkins community

3)click on download and click on windows & it will start download

4)unzip the file, then double click on exe. file& install the jenkins.

5) After installation access the jenkins by using http://localhost:8080/

6)password—go to--programfile/jenkins/secrets/intialpassword-

=============================================================

In Order to create Maven Project in Jenkins we should mandatory install below plugin

i>Maven Integration Plugin }

-Manage Jenkins=> Manage Plugins

ii>GitHub Integration Plugin }

->In Order to install above plugin go to jenkin menu & click on manage Jenkin-> then click on Manage Plugin

->Click on available tab->Search for Maven Integration

->check & click on Install without restart.

Note:- In order to download Maven From Git location & execute Maven Project in Jenkin Server.

===========================================================

->Go to Jenkins & click on Manage Jenkins-> Click On global tool congiguration-> Add JDK->Name-
>Java_Home path of JDK with bin(till bin).

->go to git->Path to get executable [C:\program\git.exe]

->go to Maven

Name:Maven_Home

Maven_Home:C:Selenium\....\Pom.xml

=========================================================================
====

***Below Environment should be set.

1) [Add JDK] [Go to (Global Tool Configuration) and click add jdk]

JDK Env Means


JAVA_HOME:VARIABLE (JAVA_HOME:c:/progfiles/Java/JDK 1.8.0)

[ADD MAVEN]

2)M2_HOME: Variable (Maven_Home:C:/apache_maven_3.6.1)

[Add Git](install git to system ::https://git-scm.com/download/win)

Path to Git Executable: C:/program files/Git/bin/git.exe(This is not in system variable(or)Local System only .A
jenkins)

3)Git Variable

=============================================================

Build Trigger (0-23Hrs) (1-12Months) -> ( 4 21 23 8 5)

| | | | |---Aug/23/2019(5-
friday)9.04pm(or 21.04)

Build Schedule-> * * * * * ***

Periodically | | |------Day of Week

Min Day of (0-7)SUN,MON...

(0-59) Month
(1-31)

[Space & space for every stars]

Poll SCM:- * * * * *->Executes when ever any one changes the frame work in the github

================================================================

Step1:-> New Item-> Select Maven project -> get Inside Project->Click on configure-> click on git & provide
path of repository from clone.

or

=======================================================

How to create Project/Job:->

1)Login to jenkins,click on New Item and select maven project and provide the name for the project & click on ok.

2)Provide a project description, select github project & provide github project url.

3)In source code Management select git & provide repository

credentials.

4)Click on save button


How to schedule the project in jenkins:->

1)Login to jenkins, select the project ->click on configure ->select build periodically checkbox & put schedule in
5* pattern.

e.g. 28 9 * ** * & click on save.

Note:[Under Build and Root POM]: \git Project Name\POM.xml(ex: \SDET Project\POM.xml )

Goals and option --test

How to provide recipient mail to address to selector:->

1)Login to jenkins-> select the project -> click on configure ->under Build settings, provide a recipient mail
address and click on save...

You might also like