Earn Money in 10 days

Selenium Videos

Protractor In Selenium

Livechat

Sunday, 27 March 2016

DataProvider in Multiple Classes

If you have to use one  dataprovider in multiple classes of your project so for that we need to make our dataprovider static and then after making it static we can use that in every class where we need.


You have to follow this rule only just make your data provider as static and give the name to your data provider .

@Test(dataProviderClass = YourDataProviderClassname.class,dataProvider = dataprovidername)


By this Program/code you can run your dataprovider in multiple classes

import org.testng.annotations.DataProvider;


public class dataProvider {

@DataProvider(name = "logintestdataprovider")
//give the name to your dataprovider.Here your dataprovider name = logintestdataprovider
public static  Object[][] getData(){
Object data[][] = new Object [3][2];
data[0][0] = "ritu7181";
data[0][1] = "password1";
data[1][0] = "ritu7180";
data[1][1] = "password2";
data[2][0] = "ritu7182";
data[2][1] = "password3";
return data;
}

}
Now next step is to call this dataprovider to your test class.
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.Test;


public class Registration {
@Test(dataProviderClass = dataProvider.class,dataProvider = "logintestdataprovider")
public void Login(String username,String password) throws InterruptedException{
WebDriver driver = new FirefoxDriver();
driver.get("https://gmail.com");
driver.findElement(By.xpath("//*[@id='Email']")).sendKeys(username);
Thread.sleep(5000);
driver.findElement(By.xpath("//*[@id='next']")).click();
Thread.sleep(3000);
driver.findElement(By.xpath("//*[@id='Passwd']")).sendKeys(password);
driver.findElement(By.xpath("//*[@id='signIn']")).click();
Thread.sleep(5000);
}

}
You can use that dataprovider in multiple classes you need.I have just use in one class you can use that in multiple classes.

Saturday, 26 March 2016

Data Driven Testing using DataProvider

DataDriven Testing Using DataProvider

Testing with multiple sets of data is called data driven Testing.If you have to login with multiple username and password then we have to perform data driven testing.
By using  DataProvider annotation provided by TestNG we can perform Data Driven Testing.
DataProvider is one such feature in testng; it allows a test method to be executed with multiple sets of data.
DataProvider methods return two dimension object array.

@DataProvider
public Object[][] getData(){
Object data[][] = new Object [2][2];
//We have just initilize the data and this  new Object [3][2]; means 3 rows two colouns.
data[0][0] = "Username1";
//data at 0 row and 0 colomn.
data[0][1] = "password1";
data at 0 row and 1 colomn.
data[1][0] = "username2";
data at 1 row and 0 colomn.
data[1][1] = "password2";
data at 0 row and 1 colomn.
data[2][0] = "username2";
data at 2 row and 0 colomn.
data[2][1] = "password2";
data at 2 row and 1 colomn.
return data;

}
By using these code we can perform data driven Testing.

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

public class datadriven {

@Test(dataProvider = "getData")
public void loginTest(String username,String password) throws InterruptedException{
WebDriver driver = new FirefoxDriver();
driver.get("https://gmail.com");
driver.findElement(By.xpath("//*[@id='Email']")).sendKeys(username);
Thread.sleep(5000);
driver.findElement(By.xpath("//*[@id='next']")).click();
Thread.sleep(3000);
driver.findElement(By.xpath("//*[@id='Passwd']")).sendKeys(password);
driver.findElement(By.xpath("//*[@id='signIn']")).click();
Thread.sleep(5000);
}

@DataProvider
public Object[][] getData(){
Object data[][] = new Object [3][2];
data[0][0] = "Username1";
data[0][1] = "password1";
data[1][0] = "username2";
data[1][1] = "password2";
data[2][0] = "username3";
data[2][1] = "password3";
return data;
}

}

Wednesday, 9 March 2016

Ask any topic related on testing or Selenium Webdriver.

Hello guys now you can ask any topic or any article on testing and  Selenium.
We will provide you articles + video tutorial.

Wednesday, 2 March 2016

Severity and Priority in Software Testing

Difference between Priority and Severity 

Priority and Severity are the two most software aspects in software Testing.
On the basis of severity and priority developer will fix that issue.Both Severity and Priority are main attributes of a defect and should be provided in the bug report.

Priority is defined as how quickly that bug will be fixed.
Now how we will define the priorities and severity.

Severity can be of Following types:

Critical/Show Stopper/S1:If the application is not working properly.Any of the module/component is defected or blocked and without that you can't proceed in other modules.

Major/S2:In this some of the major modules are defected but some are working.So severity is major.

Moderate/S3:The defect by which that does not results in termination but produced incorrect results then severity will be Moderate.

Minor/S4:The defect which does not effect the functionality but still valid defect like spelling mistakes in validation messages.So severioty will be minor.

Priority:This defines the importance of the defect when it should be fixed.

Priority has following Types:

High:If the status is High then defect should be fixed immediatly before the product is released.

Medium:End user can't work with some of the functionality of the module so it can be fixed in next release.
Low:Very Less impact on end user.


Priority and Severity is given by Tester to developer in bug report:

High Priority and High Severity:
Customers are getting errors of 404 error while online booking of ticket.So priority and severity is Higher.

High Priority and Low Severity
If their is a spelling mistake on the home page of company website.

Low Priority and High Severity:
A system is not working correctly but it can be fixed in next build.
For Example:Customers are purchasing the items they can't add the product in the cart but it is not working on very old browers.

Low severity and low priority
By this user is not effecting for example terms and condition page is taking higher time to load.


Popular Posts

 
subscribe
Subscribe Us
emailSubscribe to our mailing list to get the updates to your email inbox... We can't wait more to have your email in our subscribers email list. Just put your nice email in below box: