Posts

Showing posts from August, 2018

Parameterization in TestNG Using DataProvider Annotation

Image
package seleniumprograms; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.testng.Assert; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeMethod; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; public class Parameterization { WebDriver driver; @BeforeMethod public void setUp(){ System.setProperty("webdriver.chrome.driver",System.getProperty("user.dir")+"\\drivers\\chromedriver.exe"); driver = new ChromeDriver(); driver.get("http://newtours.demoaut.com/"); driver.manage().window().maximize(); driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); driver.manage().timeouts().pageLoadTimeout(60, TimeUnit.SECONDS); } @Test(dataProvider="loginDataProvider") public void search(String username, String password, String ...

How to run a Selenium Project from Jenkins [Continuous Integration Tool] with Extent Report Setup

Image
What is Jenkins? Jenkins is a powerful application that allows continuous integration and continuous delivery of projects, regardless of the platform you are working on. It is a free source that can handle any kind of build or continuous integration. You can integrate Jenkins with a number of testing and deployment technologies. Steps To Download Jenkins Download jenkins.war file from  https://updates.jenkins-ci.org/download/war/   Place the jenkins.war file in a folder (i.e. C:\jenkins\) Now open command prompt and write cd  C:\jenkins\ to navigate to the folder where "jenkins.war" file is located. Now write java -jar jenkins.war and press Enter Once you see the below message then you can get started with Jenkins by using HTTP://localhost:8080 URL. After completing the Jenkins installation process, a browser tab will pop-up asking for the initial Administrator password.  The initial A...