iOS Code Compare process 1) Search "File Merge" into MacBook 2) Create a folder and add both projects which we want to compare ex Old Project and New Project 3)After launching File Merge Tool -> We are getting a window which has two options Left and Right 4)Then Fetch Old Project into Left and New Project into Right. Wait for the complete process 5)We will get Folder->File structure into File Merge 6)Select particular file which we want to compare In That we will get number chnages count Changes getting in gray and light blue color Android Code Compare process 1)Start Android Studio and open New Project 2)Right Click on Project->Compare to then select Old Project 3)The we will get comparism window which have both projects files 4)Differences highlighed by gray color
iOS and Android Project Code Compare Steps
Pattern Printing in Java
1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 1 2 3 4 5 6 1 2 3 4 5 6 7 package programs; public class PatternProgram1 { public static void main(String[] args) { for(int i =1;i<=7;i++){ for(int j =1; j<=i;j++){ System.out.print(j+" "); } System.out.println(); } } } *************************************************************************************************************** 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 package programs; public class PatternProgram2 { public static void main(String[] args) { for(int i =1;i<=7;i++){ for(int j =1; j<=i;j++){ System.out.print(i+" "); } System.out.println(); } } } *************************************************************************************************************** 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 1 2 3 4 5 6 1 2 3 4 5 6 7 1 2 3 4 5 6 1 2 3 4 5 1 2 3 4 1 2 3 1 2 1 package programs; public class PatternProgram3 { public static void main(String[] args) { for(int i =1; i<=7;i++){ for(int j =1; j<=i;j++){ System.out.print(j+" "); } System.out.println(); } for(int i=6;i>=1;i--){ for(int j =1; j<=i;j++){ System.out.print(j+" "); } System.out.println(); } } } ***************************************************************************************************** 1 2 3 4 5 6 7 1 2 3 4 5 6 1 2 3 4 5 1 2 3 4 1 2 3 1 2 1 package programs; import java.util.Scanner; public class PatternProgram5 { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.println("enter input data"); int number = scanner.nextInt(); for(int i=number;i>=1; i--){ for(int j = 1; j<=i;j++){ System.out.print("j"+" "); } System.out.println(); } } } *********************************************************************************************************** 7 6 5 4 3 2 1 7 6 5 4 3 2 7 6 5 4 3 7 6 5 4 7 6 5 7 6 7 package programs; import java.util.Scanner; public class PatternProgram6{ public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.println("enter input data"); int number = scanner.nextInt(); for(int i =1; i<=number;i++){ for(int j = number; j>=i;j--){ System.out.print(j+" "); } System.out.println(); } } } ******************************************************************************************************* 1 2 3 4 5 6 7 1 2 3 4 5 6 1 2 3 4 5 1 2 3 4 1 2 3 1 2 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 1 2 3 4 5 6 1 2 3 4 5 6 7 package programs; public class PatternProgram7 { public static void main(String[] args) { for(int i =7; i>=1; i--){ for(int j =1 ; j<=i; j++){ System.out.print(j+" "); } System.out.println(); } for(int k = 2; k<=7; k++){ for(int j =1 ; j<=k; j++){ System.out.print(j+" "); } System.out.println(); } } } ********************************************************************************************** 1 1 2 1 1 2 3 2 1 1 2 3 4 3 2 1 1 2 3 4 5 4 3 2 1 1 2 3 4 5 6 5 4 3 2 1 1 2 3 4 5 6 7 6 5 4 3 2 1 package programs; public class PatternProgram8 { public static void main(String[] args) { for(int i = 1; i<=7; i++){ for(int j = 1; j<=i; j++){ System.out.print(j+" "); } for(int j = i-1; j>=1; j--){ System.out.print(j+" "); } System.out.println(); } } }
Github Tutorial and Basic Commands
GitHub Tutorial 1)Introduction to GitHub GitHub is a highly used software which is typically used for version control. It is helpful when more than just one person is working on a project. Say for example, a software developer team wants to build a website and everyone has to update their codes simultaneously while working on the project. In this case, Github helps them to build a centralized repository where everyone can upload, edit and manage the code files. Step 2: Creating a GitHub Repository a)Go to the link: https://github.com/ . Fill the sign up form and click on “Sign up for Github”. b)Click on “Start a new project”. c)Enter any repository name and click on “Create Repository”. You can also give a description to your repository (optional). Step 3: Create Branches and Perform Operations Branching: Branches help you to work on different versions of a repository at one time. Let’s say you want to add a new feature (which is in the development phase), and you are afraid at the same time whether to make changes to your main project or not. This is where git branching comes to rescue. Branches allow you to move back and forth between the different states/versions of a project. In the above scenario, you can create a new branch and test the new feature without affecting the main branch. Once you are done with it, you can merge the changes from new branch to the main branch. To create a branch in GitHub, follow the below steps: a)Click on the dropdown “Branch: master” b)As soon as you click on the branch, you can find an existing branch or you can create a new one. In my case, I am creating a new branch with a name “readme- changes”. Refer to the below screenshot for better understanding. CreateBranches - how to use GitHub - Edureka Commit Command: This operation helps you to save the changes in your file. When you commit a file, you should always provide the message, just to keep in the mind the changes done by you. Though this message is not compulsory but it is always recommended so that it can differentiate the various versions or commits you have done so far to your repository. Pull Command Pull command is the most important command in GitHub. It tell the changes done in the file and request other contributors to view it as well as merge it with the master branch. Once the commit is done, anyone can pull the file and can start a discussion over it. Once its all done, you can merge the file. Pull command compares the changes which are done in the file and if there are any conflicts, you can manually resolve it
Git task | Notes | Git commands |
---|---|---|
Tell Git who you are | Configure the author name and email address to be used with your commits. Note that Git strips some characters (for example trailing periods) from |
git config --global user.name "Sam Smith"
|
Create a new local repository | git init |
|
Check out a repository | Create a working copy of a local repository: | git clone /path/to/repository |
For a remote server, use: | git clone username@host:/path/to/repository |
|
Add files | Add one or more files to staging (index): | git add <filename> git add * |
Commit | Commit changes to head (but not yet to the remote repository): | git commit -m "Commit message" |
Commit any files you've added with git add , and also commit any files you've changed since then: |
git commit -a |
|
Push | Send changes to the master branch of your remote repository: | git push origin master |
Status | List the files you've changed and those you still need to add or commit: | git status |
Connect to a remote repository | If you haven't connected your local repository to a remote server, add the server to be able to push to it: | git remote add origin <server> |
List all currently configured remote repositories: | git remote -v |
|
Branches | Create a new branch and switch to it: | git checkout -b <branchname> |
Switch from one branch to another: | git checkout <branchname> |
|
List all the branches in your repo, and also tell you what branch you're currently in: | git branch |
|
Delete the feature branch: | git branch -d <branchname> |
|
Push the branch to your remote repository, so others can use it: | git push origin <branchname> |
|
Push all branches to your remote repository: | git push --all origin |
|
Delete a branch on your remote repository: | git push origin :<branchname> |
|
Update from the remote repository | Fetch and merge changes on the remote server to your working directory: | git pull |
To merge a different branch into your active branch: | git merge <branchname> |
|
View all the merge conflicts: View the conflicts against the base file: Preview changes, before merging: |
git diff
git diff <sourcebranch> <targetbranch> |
|
After you have manually resolved any conflicts, you mark the changed file: | git add <filename> |
|
Tags | You can use tagging to mark a significant changeset, such as a release: | git tag 1.0.0 <commitID> |
CommitId is the leading characters of the changeset ID, up to 10, but must be unique. Get the ID using: | git log |
|
Push all tags to remote repository: | git push --tags origin |
|
Undo local changes | If you mess up, you can replace the changes in your working tree with the last content in head: Changes already added to the index, as well as new files, will be kept. |
git checkout -- <filename> |
Instead, to drop all your local changes and commits, fetch the latest history from the server and point your local master branch at it, do this: | git fetch origin git reset --hard origin/master |
|
Search | Search the working directory for foo() : |
git grep "foo()" |
GITHub Project Push Commands 0) git config --global user.email "Your-Email" 1) git init 2) git status 3) git add . // add all current directory files 4) git commit -m "First Commit" 5) git remote add origin "repository URL" 6) git push origin master Pull Single file from GITHub git checkout -b Branch_name Delete Single file from GITHub git branch -d Branch_name To update local repository to the newest commit git pull
To create new branch please follow below steps Note : while creating new branch, switch to develop or Your latest code branch and create your branch by referring that specific branch. 1. Switch to develop branch (git checkout develop) 2. Update your local develop branch by taking a pull request (git pull origin develop) 3. Created new branch eg. NotificationTest (git checkout -b NotificationTest) 4. Write a code in that branch 5. Perform git add . and git commit 6. Push the code to remote repo (git push origin branch_name ) 7. Raised Pull request for “NotificationTest” Refer this https://confluence.atlassian.com/bitbucketserver/basic-git-commands-776639767.html How to review PR:- 1. Open the PR 2. Go to Files changed tab ( This is where you will see what changes were made in this PR. What files were deleted/added etc ) 3. Click on green Review Changes button ( This is after you finished reviewing everything ) 4. Write a comment ( Generally “LGTM” which means Looks Good To Me ) in Leave a comment box. 5. Select Approve option ( To approve ) 6. Click Submit review Basic Git commands | Bitbucket Data Center and Server 8.1 | Atlassian Documentation https://confluence.atlassian.com Git CheatSheet.
Selenium: Different Wait Examples
ExplicitWait WebDriverWait wait = new WebDriverWait(driver, 30); wait.until(ExpectedConditions.elementToBeClickable(By.cssSelector("button[type='submit']"))); ImplicitWait driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
Selenium:- Find Broken Links
FindBrokenLink.java import java.util.ArrayList; import java.util.List; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import org.testng.annotations.AfterTest; import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; import com.utility.GetReponseCode; public class FindBrokenLink { WebDriver driver; // It will open the browser & Application before Test @BeforeTest public void openBrowser() { System.setProperty("webdriver.chrome.driver", "D://Drivers//chromedriver.exe"); driver = new ChromeDriver(); //To maximize the Window driver.manage().window().maximize(); //To Open the Application driver.get("http://www.oyepages.com"); } @AfterTest public void tearDown() { if (driver != null) driver.close(); } @Test public void getBrokenLinks() { // Find all Elements on the page with 'a' tag ListallLinks = driver.findElements(By.tagName("a")); System.out.println("Total Number of Links : " +allLinks.size()); //Iterate over all available Links on webpage for (WebElement link : allLinks) { String linkURL = link.getAttribute("href"); //Call VerifyURL form GetResponse Code Class GetReponseCode.verifyUrl(linkURL); } System.out.println("Total Number of Links : " +allLinks.size()); GetReponseCode.getInvalidLinkCount(); } } GetReponseCode.java import java.net.URL; import javax.net.ssl.HttpsURLConnection; public class GetReponseCode { static int inValidLink; public static void verifyUrl(String linkURL) { try { URL url = new URL(linkURL); HttpsURLConnection urlConnect = (HttpsURLConnection) url.openConnection(); // Set Connection TimeOut urlConnect.setConnectTimeout(5000); // Open Communication link to resource URL urlConnect.connect(); // To verify the Response Code if (urlConnect.getResponseCode() == 200) { System.out.println( linkURL + " : " + urlConnect.getResponseCode() + " : " + urlConnect.getResponseMessage()); } else if (urlConnect.getResponseCode() == urlConnect.HTTP_NOT_FOUND) { System.out .println(linkURL + " : " + urlConnect.getResponseMessage() + " : " + urlConnect.HTTP_NOT_FOUND); inValidLink++; } } catch (Exception e) { } } public static void getInvalidLinkCount() { System.out.println("Total Invalid Links : " + inValidLink); } }
Selenium:- Handle Web Tables
import java.util.List; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; public class WebTableExample { WebDriver driver; // It will open the browser & Application before Test @BeforeMethod public void openBrowser() { System.setProperty("webdriver.chrome.driver", "D://Drivers//chromedriver.exe"); driver = new ChromeDriver(); driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); driver.manage().window().maximize(); driver.get("http://money.rediff.com/gainers/bse/daily/groupa?src=gain_lose"); } // It will close the Browser after Test @AfterMethod public void tearDown() { if (driver != null) driver.close(); } @Test public void countTotalRowsTest(){ ListallRows = driver.findElements(By.xpath("//*[@id='leftcontainer']/table/tbody/tr")); System.out.println("Total No of Rows : " +allRows.size()); } @Test public void printAllRowsTest(){ List allRows = driver.findElements(By.xpath("//*[@id='leftcontainer']/table/tbody/tr")); System.out.println("********** Starting Table ************"); for (int row = 0; row < allRows.size(); row++) { System.out.println(allRows.get(row).getText()); } System.out.println("********** Ending Table ************"); } @Test public void countAllColsTest(){ List allCols = driver.findElements(By.xpath("//*[@id='leftcontainer']/table/tbody/tr[1]/td")); System.out.println("Total No of Cols : " +allCols.size()); } @Test public void printCompleteColumnTest(){ List firstColumn = driver.findElements(By.xpath("//*[@id='leftcontainer']/table/tbody/tr/td[4]")); for (int i = 0; i < firstColumn .size(); i++) { System.out.println(firstColumn.get(i).getText()); } } @Test public void printSpecificRowTest(){ WebElement row = driver.findElement(By.xpath("//*[@id='leftcontainer']/table/tbody/tr[5]")); System.out.println(row.getText()); } }
Selenium:- Different Mouse and Keyboard Events Handling
DoubleClick @Test public void performDoubleClick() throws InterruptedException{ WebElement ele = driver.findElement(By.xpath("//button[contains(.,'Double-Click Me To See Alert')]")); Actions act = new Actions(driver); act.moveToElement(ele).perform(); act.doubleClick().perform(); Thread.sleep(5000); Alert alert = driver.switchTo().alert(); alert.accept(); Thread.sleep(5000); } Switch Alert Alert alert = driver.switchTo().alert(); alert.accept(); Thread.sleep(5000); } DragAndDrop @Test public void performDragAndDrop() throws InterruptedException{ WebElement iFrame = driver.findElement(By.className("demo-frame")); driver.switchTo().frame(iFrame); // Store the web elements WebElement src = driver.findElement(By.id("draggable")); WebElement dest = driver.findElement(By.id("droppable")); Thread.sleep(2000); Actions act = new Actions(driver); act.dragAndDrop(src, dest).build().perform(); Thread.sleep(5000); } @Test public void performDragAndDrop2() throws InterruptedException{ WebElement iFrame = driver.findElement(By.className("demo-frame")); driver.switchTo().frame(iFrame); // Store the web elements WebElement src = driver.findElement(By.id("draggable")); WebElement dest = driver.findElement(By.id("droppable")); Thread.sleep(2000); Actions act = new Actions(driver); act.clickAndHold(src).moveToElement(dest).release().perform(); Thread.sleep(5000); } Keyboard Events @Test public void performDragAndDrop() throws InterruptedException{ WebElement text = driver.findElement(By.name("firstname")); Actions builder = new Actions(driver); builder.keyDown(Keys.SHIFT) .sendKeys(text, "anshul") .keyUp(Keys.SHIFT) .build().perform(); Thread.sleep(5000); } Mouse Hovor @Test public void performMouseHover() throws InterruptedException{ WebElement seleniumLink = driver.findElement(By.xpath("//*[@id='menu-item-10548']/a")); Actions act = new Actions(driver); act.moveToElement(seleniumLink).perform(); Thread.sleep(5000); WebElement webdriverLink = driver.findElement(By.xpath("//*[@id='menu-item-9383']/a")); webdriverLink.click(); Thread.sleep(5000); } Right CLick @Test public void performRightClick() throws InterruptedException{ WebElement rightClick = driver.findElement(By.cssSelector(".context-menu-one.btn.btn-neutral")); Actions act = new Actions(driver); act.moveToElement(rightClick).perform(); act.contextClick().perform(); Thread.sleep(5000); }
Selenium :- Select
import java.util.List; import org.apache.commons.exec.OS; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.support.ui.Select; import org.testng.annotations.AfterMethod; import org.testng.annotations.AfterTest; import org.testng.annotations.BeforeMethod; import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; public class DropDownOperations { WebDriver driver; // It will open the browser & Application before Test @BeforeMethod public void openBrowser() { System.setProperty("webdriver.chrome.driver", "D://Drivers//chromedriver.exe"); driver = new ChromeDriver(); // To maximize the Window driver.manage().window().maximize(); // To Open the Application driver.get("http://www.facebook.com"); } // It will close the Browser after Test @AfterMethod public void tearDown() { if (driver != null) driver.close(); } @Test public void selectbyIndexTest() throws InterruptedException { // Store the dropdwon webelement WebElement element = driver.findElement(By.id("month")); Select oSelect = new Select(element); oSelect.selectByIndex(1); Thread.sleep(4000); } @Test public void selectbyValueTest() throws InterruptedException { // Store the dropdwon webelement WebElement element = driver.findElement(By.id("year")); Select oSelect = new Select(element); Thread.sleep(3000); oSelect.selectByValue("2007"); Thread.sleep(3000); } @Test public void selectbyTextTest() throws InterruptedException { // Store the dropdwon webelement WebElement element = driver.findElement(By.id("month")); Select oSelect = new Select(element); oSelect.selectByVisibleText("Sept"); Thread.sleep(3000); } @Test public void printAllValuesTest() throws InterruptedException { // Store the dropdwon webelement WebElement element = driver.findElement(By.id("month")); Select oSelect = new Select(element); Listmonths = oSelect.getOptions(); System.out.println("Total Options are : " + months.size()); for (WebElement monthValue : months) { String value = monthValue.getText(); System.out.println(value); } } }
Selenium:-Extend Reporting with Screenshot
Download Latest Extents Reports Jar Files and add to the project package com.objectrepository.demo; import java.io.File; import java.io.IOException; import org.apache.commons.io.FileUtils; import org.openqa.selenium.OutputType; import org.openqa.selenium.TakesScreenshot; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; import com.relevantcodes.extentreports.ExtentReports; import com.relevantcodes.extentreports.ExtentTest; import com.relevantcodes.extentreports.LogStatus; public class ExtentDemo { static ExtentTest test; static ExtentReports report; static WebDriver driver; @BeforeClass public static void startTest() { report = new ExtentReports(System.getProperty("user.dir") + "\\ExtentReportResultsOutput.html"); test = report.startTest("ExtentDemo"); } public void extentReportsDemo() throws IOException { System.setProperty("webdriver.chrome.driver","C:\\New Mobile Automation\\ExtendReport\\chromedriver.exe"); WebDriver driver = new ChromeDriver(); driver.get("https://www.google.co.in"); if (driver.getTitle().equals("Google")) { test.log(LogStatus.PASS, "Navigated to the specified URL"); } else { test.log(LogStatus.FAIL, "Test Failed"); } test.log(LogStatus.FAIL,test.addScreenCapture(capture(driver))+ "Test Failed"); } public static String capture(WebDriver driver) throws IOException { File scrFile = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE); File Dest = new File("src/../ErrImages/" + System.currentTimeMillis() + ".png"); String errflpath = Dest.getAbsolutePath(); FileUtils.copyFile(scrFile, Dest); return errflpath; } @AfterClass public static void endTest() { report.endTest(test); report.flush(); } }
APPIUM Server Start and Stop through Java Programming
package demo; import org.testng.annotations.Test; import io.appium.java_client.android.AndroidDriver; import io.appium.java_client.service.local.AppiumDriverLocalService; import io.appium.java_client.service.local.AppiumServiceBuilder; import java.io.File; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import java.util.concurrent.TimeUnit; import org.openqa.selenium.remote.DesiredCapabilities; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.WebDriverWait; import org.testng.annotations.AfterTest; import org.testng.annotations.BeforeTest; import org.openqa.selenium.*; public class HannaTestScript { AndroidDriver driver; static String Appium_Node_Path="C:\\Appium\\node.exe"; static String Appium_JS_Path="C:\\Program Files\\Appium\\node_modules\\appium\\bin\\appium.js"; static AppiumDriverLocalService service; static String service_url; @BeforeTest(enabled = true) public void appiumStart() throws InterruptedException, MalformedURLException { service = AppiumDriverLocalService.buildService(new AppiumServiceBuilder(). usingPort(4723).usingDriverExecutable(new File(Appium_Node_Path)). withAppiumJS(new File(Appium_JS_Path))); service.start(); Thread.sleep(25000); service_url = service.getUrl().toString(); DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability("deviceName", "ZX1B32FFXF"); capabilities.setCapability("appPackage", "com.hannainst.hannalab"); capabilities.setCapability("appActivity","com.hannainst.hannalab.ManagerActivity"); driver= new AndroidDriver(new URL(service_url),capabilities); driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS); } @Test public void Test_AppLaunch() throws Exception { try{ WebDriverWait wait = new WebDriverWait(driver, 300); wait.until(ExpectedConditions.elementToBeClickable(By.className("android.widget.RelativeLayout"))); System.out.println("TC0 :-App Launched Successfully"); }catch(Throwable e) { System.out.println("TC0:-Test Case Failed"); } } @AfterTest public void appiumStop() throws IOException { driver.quit(); service.stop(); } }
Java Project, Jenkins and GIT Intergration
Jenkins and GIT Integration Java Project Creation with ythe help of Eclipse 1)Create Java Project 2)Create "demo" package 3)Create Java File "HelloWorld.java" package demo; public class ReverseNumber { public static void main(String[] args) { System.out.println("Hello World"); } } 4)Run Above code from Windows Command Prompt a)Go to the project folder ex. cd C:\ABC\JenkinandGitJavaProgram\src\demo b)Enter following command ex javac HelloWorld.java c)If we enter " java HelloWorld.java" then it give us error due to java constraint Enter "java demo.ReverseNumber" Package should be required before ClassName 5)We will get output "Hello World" Jenkins and Java Project Integration Jenkins->Manage Jenkins->Global Tool Configuration Need to installed following plugins HTML Publisher plugin TestNG Result Plugin Selenium HTML report 1)Install Jenkins 2)Start Jenkins server a)First go to the jenkins folder ex "C:\Program Files (x86)\Jenkins> b)Run Jenkins.war ex. "C:\Program Files (x86)\Jenkins>java -jar jenkins.war" 3)Login Jenkins Server by using username and password 4)Click on "New Item" to create new jenkin project 5)Then Enter Project Name ex ""HelloWorld" and select Free Style Project 6)Ok and Save 7)Go to the Configure->Build-> select "Execute Windows Batch Envirnoment" and enter folloing commands cd C:\ABC\JenkinandGitJavaProgram\src\demo javac HelloWorld.java cd.. java demo.HelloWorld 8)Apply and Save 9)Click on "Build Now" and see ouput on "console window" Jenkins and Java Project and GIT Integration 1)Firstly Jenkins and Java Project Integration required, Install GIT Plugin into Jenkins via Manage Jenkins 2)Create a Github Account 3)Create a repository on GitHub ex "HelloWorldJava" 4)Then make the following changes into "Source Code Management" of Jenkins->HelloWorld a)Select git instead of None to access code from a git repository b)Then Enter git repository URL ex. "https://github.com/vpkhachane/HelloWorldJava.git" c)Then In "Build Triggers" Tick "Poll SCM" Option and enter "* * * * *", this star execute script per minute d)Then Apply and save it Procedure to upload our project on GIT Repository Login to Git and create a new repository and copy path for future reference "https://github.com/vpkhachane/HelloWorldJava.git" Go to git bash command Prompt-> set project working directory ex. cd C://NewMobileAutomation//VaibhavTestingPractice// git init //to initialize empty git repository on GitHub git status //to check the git update status git add . //add files git commit -m "Hello Java Program" git remote add origin https://github.com/vpkhachane/HelloWorldJava.git git push -u origin master To download Project git clone https://github.com/vpkhachane/FirstGitPractice.git to download changes made by others git pull Jenkins execute the HelloWorld Project after every change For Jenkin Scheduler. We can follow the following steps 1)Start Jenkins 2)Open Project 3)Configure->Build Triggers-> 4)Tick Build periodically option 5)Add Scheduler criteria ex. use "* * * * *"for every 1 minutes , "*/2 * * * *" for every two minutes, "*/15 * * * *" for every 15 minutes Rerer link for timer
Subscribe to:
Posts (Atom)