Monday 16 February 2015

GUI Testing

GUI Testing : GUI testing is nothing but testing the application's user interface elements like textboxes,checkboxes etc to see whether they are working according to the requirements or not.the main intention behind this type of testing is to see how application responds to user input.

Below I'm listing down few User Interface Elements and you need to test cases for them and then test to see whether they are working as expected or not.

1) Checkboxes
2) Textboxes.
3) Buttons
4) Radio buttons
5) List Boxes.

What to Test with UI elements..? : Well below I'm listing down few conditions to be test for different UI elements.

* Checkboxes : check whether one checkbox is allowed to check or more than one checkbox allowed to check.
* Checkboxes : check the spelling of the title associated with the checkboxes.
* Checkboxes : check the font size of the title associated with the checkboxes.
* Checkboxes : if there are more than one checkbox then see whether checkboxes are of same size or not.
* Textboxes : check textboxes for various validations like whether they accept numbers,special characters,alphabets,more than 256 characters etc or not.
* Textboxes : check the spelling of the title associated with the textboxes.
* Textboxes : check the font size of the title associated with the textboxes .
* Textboxes : if there are more than one textbox then see whether textboxes are of same size or not.
* Buttons : check the response of application when buttons are clicked by user
* Radio Buttons : check the response of application when radio buttons are clicked by user.
* Radio Buttons : check if application is allowing to select more than one radio button at once or not.
* List Boxes : check if application is allowing user to select more than one value at once or not.
* List Boxes : check the spelling of all values in list boxes.
* List Boxes : check the font size of all values in list boxes.

I hope GUI testing is clearing now..:)


Mouse Hover in Selenium Webdriver

Mouse Hover In Selenium Webdriver : Go to the url: http://www.guru99.com/ and mouse hover on 'Testing' and click on 'Selenium' , below I'm adding the code kindly execute it.


package GuruMouseHover;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.interactions.Actions;


public class Guru {

    public static void main (String[] args)
    {

        try{

            WebDriver driver = new FirefoxDriver();         
            driver.get("http://www.guru99.com");
            WebElement element = driver.findElement(By.linkText("Testing"));
            Thread.sleep(2000);
            Actions action = new Actions(driver);
            action.moveToElement(element).build().perform();

//Click on Selenium
            driver.findElement(By.xpath(".//*[@id='rt-header']/div/div[2]/div/ul/li[2]/div/div/ul/li[3]/a")).click();
      
        driver.close();
      
        }
        
        catch(Exception e)
        {
            System.out.println(e);
        }
    }
  
  
}

Regression Testing

Regression Testing : Regression testing is nothing but testing the existing software to make sure that software is working correctly if it has undergone some changes. Regression testing is required when

1) Code has undergone some changes.
2) New functionality has been added to the software.
3) Existing functionality has been modified to the software.

Goals of Regression Testing :

1) Whenever code has undergone some changes then developers give us build for testing then testers job is to check whether all the functionality is working fine and changing of code has not affected the functionality of the software.

2) Whenever new functionality has been added then testers need to test whether new added functionality is working according to the requirements, whether newly added functionality has affected other functionalities of the software, whether newly added functionality has given rise to new bugs and how the newly added functionality is affecting the performance of the software.

How to Perform Regression Testing..? :

Well this is totally depend on the organization you are working for but majority of the companies prefer using tools like Selenium,QTP to perform regression testing and even i prefer using tools like selenium because it is less time consuming than Manual Testing. if you are using tools like selenium then below I'm listing the steps you must follow in order to perform Regression testing.

1) Find out the areas which has undergone changes.
2) Select already existing test cases belong to that area and keep them separately for regression testing.
3) If any new functionality has been added then write test cases for that and keep them separately for regression testing.
4) Once you are done with prioritizing test cases then write selenium scripts based on test cases.
5) Execute selenium scripts and prepare the overall report and send to it concerned person.

It is not necessary to follow above mentioned steps to perform Regression testing and steps may differ from company to company.:)

Compatibility Testing

In this post I'm going to explain about compatibility testing

Compatibility Testing : it is a type of non functional testing where can we see how software works across various browsers,mobile devices,network,databases and operating systems.

Suppose you are testing a website then following factors need to be considered when doing compatibility testing.

* Browsers compatibility - Website has to work uniformly across many browsers like IE,Safari,Firefox,Chrome etc.

* Network - Website has to function correctly under various networks like Wifi,3G etc.

* Versions - Website has to run correctly under different browser version. eg: Website has to work correctly in Firefox 33 and Firefox 34.

Suppose you are testing Desktop application then following factors need to be considered when doing compatibility testing.

* Operating Systems : Desktop app has to work perfectly in different OS like Windows XP,Windows7,Mac,Linux etc.

* Hardware : Desktop app has to work in different machines like 32 bit, 64 bit etc based on requirements.

* Network : Desktop app has to work correctly under various networks like Wifi,3G etc

Suppose you are testing a Mobile App(Android) then following factors need to be considered when doing compatibility testing.

* Mobile Devices : App has to work perfectly for different android devices and for different Android Versions.

* Network : App has to work correctly under various networks like Wifi,3G,2G etc.

This is how compatibility testing works and above mentioned factors for various types may differ based on requirements but remember one thing the goal is to make sure that software works correctly across browsers,networks etc.:)

Smoke Testing and Sanity Testing

In this Post i'm going to explain what is Smoke Testing and Sanity Testing, well these two are very confusing hence need to understand properly.

Smoke Testing : * Smoke testing is a type of testing where we we actually test the most critical parts of the software before going for complete testing.

* Aim is to make sure critical parts work perfectly before doing full complete testing and we do this in order to save time.

* Smoke testing is scripted one means we write test cases and execute those test cases.

* Whenever testers get  build for testing then they do smoke testing before going for System or Functional Testing.

Sanity Testing : * Sanity testing is a type of testing where we test only those parts which has been changed or where bugs were there.

* Sanity testing is to check whether developer has applied some sanity while making changes and whether software works according to requirement or not.

* Sanity testing is unscripted one means we don't have to write test cases, we can directly start testing the software.

* Sanity testing is nothing but roughly testing the parts of the software and not thoroughly testing the parts of the software.

Tuesday 27 January 2015

Handling Multiple Tabs in Selenium Webdriver

Hi, In this post I'm gonna explain you how to handle multiple tabs in selenium webdriver, well it is quite easy to handle it but remember selenium webdriver will open new window instead of new tab.

For Handling multiple tabs I'm going to use URL:http://irctc.co.in/, kindly execute below mentioned code.

Code:

package NewTabtest;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

import java.util.ArrayList;

public class NewTab {

    public static void main(String[] args) {
        try{
           
            WebDriver driver = new FirefoxDriver();
            driver.get("https://www.irctc.co.in");
           
            driver.manage().window().maximize();
           
            driver.findElement(By.xpath(".//*[@id='bluemenu']/ul/li[4]/a")).click();
           
            ArrayList<String> tabs2 = new ArrayList<String> (driver.getWindowHandles());
    

          //Switching to new tab 'Tourist Trains'.
            driver.switchTo().window(tabs2.get(1));
           
            String me = "Tourist Trains";
           
            String mee = driver.findElement(By.xpath(".//*[@id='mainpannel']/div/h1")).getText();
           
            if(mee.equals(me))
            {
                System.out.println("Matches");
            }
           
            else
            {
                System.out.println("Doesn't matches");
            }

           //Closing the second tab 'Tourist Trains'
            driver.close();

          //Switching back to Home Tab
            driver.switchTo().window(tabs2.get(0));
           
            String se = "View All";
           
            String see = driver.findElement(By.xpath("html/body/div[1]/div/div[10]/div/div/div[1]/span/a")).getText();
           
           
            if(see.equals(se))
            {
                System.out.println("Matches");
            }
           
            else
            {
                System.out.println("Doesn't matches");
            }
           
            driver.close();
        }
   
    catch (Exception e)
    {
    }
    }
}


So this is how we handle multiple tabs, i hope you guys understood this post..:)

Monday 26 January 2015

Database Performance Testing Using Jmeter

Hi friends, this is my second post in Jmeter and in this post I'm gonna explain you how to test database using Jmeter and for that i will be using MySql database.

Step 1: Download MySql Java Connector 5.1.34 from the URL:http://mvnrepository.com/artifact/mysql/mysql-connector-java/5.1.34.

Step 2: Once download is complete then copy mysql-connector-java-5.1.34.jar into lib folder of Apache jmeter.


Step 3: Start Jmeter and right click on Test Plan and add Thread Group and give any value you want to give, I'm going to give value as 20.


Step 4 : Right click on Thread Group and add 'JDBC Connection Configuration' element and your element should look like this.


in the above image if you could see database URL:jdbc:mysql://localhost:3306:/forjmeter so here 3306 is port number of mysql and 'forjmeter' is the name of the database and make sure you have created 'forjmeter' database and also created table and inserted some values into table and you can change these things accordingly.

Step 5: Right click on Thread Group and add 'JDBC Request' and after adding write a query to fetch data from database as shown below and please make sure that Variable name is same in JDBC Request and JDBC Connection Configuration elements.


Step 6: Right click on Thread Group and add few listeners and I'm going to add three listeners.


Step 7: Now save the script and click on Start symbol to run the script.


So see 'View Result Tree' all are in green color it means it's a pass and also see 'Graph Results' in that Throughput is quite high so it means database is responding well.:)

Well, This is how you can test database performance using Jmeter and please write different scripts by changing elements to test your database.cheers