martes, 17 de noviembre de 2015

Selenium and TestNg integrate to Jenkins

In previous tutorial I explained about Jenkins and how to create a job, add credentials, install plugins. Please review the last tutorial.  http://marisolchambiarrosquipa.blogspot.com/2015/10/selenium-and-junit-integrate-to-jenkins.html 

The repository that I am using is the following https://github.com/MarisolChambiArrosquipa/antProjectWithTestng.git

We will use the following test case

TestNg file

Ant build file





Install plugins 

  • install gitHub plugin
  • install testNg plugin



Set up Job

Create a new job





 Put the gitHub project


Click on Git and put the repository url and add a credential


Specify the ant build file

Add post-build action, after the execute the build, it will generate a report TestNG results


We have to specify the route where will be generated the TestNG results



Build project


Console output





lunes, 26 de octubre de 2015

Selenium and Junit integrate to Jenkins

Jenkins
Jenkins is an award-winning, cross-platform, continuous integration and continuous delivery application that increases our productivity. Jenkins is used to build and test our software projects continuously making it easier for developers to integrate changes to the project and making it easier for users to obtain  a fresh build.
Requirement
- install Java and set up environment variables
- install Ant and set up environment variables
-Download Jenkins from this page http://jenkins-ci.org/

GitHub
It offers all of the distributed revision control and source code management functionality of git as well adding its own feature.

My gitHub repository is this https://github.com/MarisolChambiArrosquipa/AntProjects, the code source is in the repository.The code source is the previous post http://marisolchambiarrosquipa.blogspot.com/2015/10/ant-iii-run-junit-with-selenium.html



It is too easy install it, select option next







It will show this page
Install plugins
install Junit plugins


we also need to install gitHub plugins



Manage Jenkins

Configure global setting and path as java, ant, maven,etc.











Create a new item

It is the project name  in GitHub












Built the project, we should select the option "build Now"


Select the Console output to see the detail of the execution




The console shows this






lunes, 12 de octubre de 2015

Run TestNG with Selenium WebDriver using Ant

Requirement, it is necessary that you review the following posts
http://marisolchambiarrosquipa.blogspot.com/2015/09/ant-ii-run-java-using-ant.html

http://marisolchambiarrosquipa.blogspot.com/2014/09/create-test-case-with-testng-and-eclipse.html

Our test case is the following




It is our xml file




Property elements
Ant build files are written in XML, which does not allow declaring variables as we do in a programming language so that we can use the PROPERTY  element which allow us to specify properties.
It is our build.xml file


Execute our build.xml file






lunes, 5 de octubre de 2015

Ant III Run JUnit with Selenium WebDriver using Ant

Requirement, you need to review the previous posts to understand better about Ant

http://marisolchambiarrosquipa.blogspot.com/2015/09/ant-part1.html
http://marisolchambiarrosquipa.blogspot.com/2015/09/ant-ii-run-java-using-ant.html

In this post, we will learn how to perform a project using Selenium WebDriver using Junit and Ant.
To understand better about Selenium webDriver with JUnit, you need to review the following post

http://marisolchambiarrosquipa.blogspot.com/2014/07/selenium-webdriver.html, in this post I explained that libraries need  and showed an example
Those classes I am using the next post http://marisolchambiarrosquipa.blogspot.com/2015/05/design-patterns.html, the unique difference is  that in that post I used TestNg, only change the annotations and it needs other library.




 the selenium-server-standalone-2.46.0.jar file include Junit


This will be our build.xml file after we need to run it.


 We need to add  the following tags, then we will run the build.xml file




lunes, 21 de septiembre de 2015

Ant II - Run Java using Ant

In previous post I explain of Ant.Review the post http://marisolchambiarrosquipa.blogspot.com/2015/09/ant-part1.html
 
We are going to follow the next steps to run a java class using Ant

1. Create a simple Java class in Eclipse








2.Write an Ant script that compiles and runs the Ant script
    2.1 Create an Xml file















    2.2 Write an Ant scripts












3.Open up a command prompt(CMD) and run the Ant script