Test strategy plan in software quality assurance

Software test strategy is a very important thing when it comes to software quality assurance.Software test plan and strategy plan are two different documents.Normally strategy plan is included in the test plan.It is nice to have a test plan in any project. But having a strategy plan is a very effective thing to do.

In an agile environment, you can create a test strategy plan for every sprint. Creating a test plan is optional.

Having a test strategy plan will help you to mitigate risks and minimize faults during the testing process. Hence it will help test team to complete a successful testing cycle.

You can create test strategy document anyway you want depend on your organizational requirements and your QA approach.

Below are the items that we used in creating test strategy document in one of my previous companies.

 

1. Scope and overview

Here you can mention an overview of the application you are going to test.And then as for the scope, mention what to test and why to test. For example,  If it is a customer registration module that you are testing, what to test is customer registration process. And why to test is to make sure you can successfully register a customer.

2. Test approach

In this section we define Test levels, Test types, Roles and responsibilities and environment requirements.

As for the test levels, You can mention unit testing (this means testing individual components separately), integrated testing, system testing, Acceptance testing(If only if this is done by QA team).

As for the test types, you can mention functional testing, regression testing, smoke testing, performance testing, security testing.

You can also mention whether you are going to do automation or not as well.

Roles and responsibilities, mention the roles and responsibilities of individual testers.

As environment requirements, mention the requirement of hardware and software needed to create the testing environment.

3. Test deliverable

In this section you can mention that you are going to produce before, during and end of the testing process. Test deliverables such as test plan, test strategy plan, test cases, test data, incident report(this helps to mitigate the future risks that will come while testing.), test status,  requirement traceability matrix test summary and test release.

4. Test tools

Mention all the testing tools you are going to use such as where to create test cases and track bugs and what tool to be used for performance testing or security testings.

5. Risk and mitigation

This section is one of the important things worth to mention according to my opinion. Because we face various difficulties during a testing process and it is always good to make a note of predictable risks that can happen and action that need to take to overcome them. For example what are you going to do if a team member goes missing(get sick or resign), what are you going to do if you not enough time to complete the testing process and what are you going to do if another urgent functionality needed to be tested during this testing process. Hence there are many more predictable risks as such.

 

How to use CSV in Postman

The API i am going to use here is a GET API, in a searching function.

Let’s create postman request for the particular API  as below.If you are passing any parameters, mention it in the parameter tab as below.

Screenshot (3202)

the particular API takes nic number as the search paramater. Therefore, when you specify it in the parameter tab, it adds to the endpoint as “HTTP://<endpoint>>/?nicnumber={{ nicnumber}}”.Then you have to add a “get” before “?” mark, as shown above.

Then you can prepare the CSV file as below.

Screenshot (3203)

Then click on runner in postman to open the collection runner.Select the API you want to evoke and click on select file in data field in the left pane.And select the CSV file.

Screenshot (3204)

You can preview it’s data by clicking on preview button in the left pane.

Screenshot (3205)

And click run test.

multiple tests will be executed for each nic number in your CSV file.

How to Setup Selenium with eclipse for Test Automation

Test automation has begun to play a major role in software testing.Cost reduction has been a major concern even in the software development industry.Therefore, test automation play a bigger role in the QA process.

As prerequisites you need to install java in your machine and download below software
-Eclipse (eclipse-jee-luna-SR2)
-Selenium for java version (http://www.seleniumhq.org/download/)
-If you are running your scripts in chrome browser, download chrome driver software (https://chromedriver.storage.googleapis.com/index.html?path=2.29/).If it is Firefox, download geckodriver(https://github.com/mozilla/geckodriver/releases).After downloading all the software, you need to run Eclipse and do the following steps to create a new project to automate your application.

  • Start Eclipse and create a new java project.Lets say the project name is “Test”
  • Right Click on the project and go to properties.
  • In the properties, go to Java Build Path.
  • Click on Add External Jars button.
  • Then add all the “jar” files inside the selenium folder and click ok.

Now you are ready to write your first test script using selenium and java.

 

How to configure IntelliJ IDEA with a Git repository in TFS (Team Foundation Server)

  • First install git.exe in your machine.(Download from here)
  • Click on ‘apply’ button.
  • Then open IntelliJ IDEA and go to it’s settings.
  • Choose menu item “git”

git

  • Enter the location of git.exe in your computer to the ‘Path to Git executable’.
  • Then search for plugin menu item in settings window.
  • In plugin window, search for the Visula Studio Team Services” plugin.

plugin

  • Select the plugin and install it.Then click on ‘apply’ button.
  • Click on ‘OK’ button to save all the changes in the settings.
  • Now, create a git repository in TFS as below.

tfsrepo

  • Now clone the repository into your PC.To do that, follow below instructions.
  1. Open IntelliJ IDEA
  2. If you open IDEA for the first time, click on “check out from version control” in the prompt window.Then select Team services Git from the drop down list.

openfromgittfs

But, if you do not open it for the first time, you will have to get the above prompt window by clicking on ‘File’ menu item and then select ‘New’ —>Project From Version Control —>Team Services Git menu items.

opengittoclone

3. Then you will see a window as below.

connecttotfs

4. Click on the Team Foundation Server tab as above and enter your TFS URL as the Server URL.Then click on Connect.You will ask your TFS login username and password.Enter then and click ‘OK’.

5. You will see the below prompt window.

clonerepofromtfs

6. Now, you can see your TFS repository as highlighted above.

7. Choose a location to clone the repository and mention it in the Parent directory input field as above image.Then click on ‘clone’ button.This will clone the repository into your machine’s given location.

8. Now you can create projects in TFS and add them to this repository folder and will be able to perform push/pull/commit git operations on them as below.

  • If you want to commit your work to the described TFS repository, just right click on the repository folder which has open in TFS and click on ‘Git’ menu item and then click on ‘Commit’ sub menu item as below.

comittotfs.png

  • Then you will see the below prompt and select the files you want to commit and click on commit and push menu item in the prompt window.Note that in order to commit and push, you must enter a commit message.

comitcodetotfs

  • Once your commit is successful, you will see a notification that files committed to TFS repository successfully.

 

How to perform Distributed/Remote testing using JMeter

For this, you need to have one JMeter master and few JMeter agents.JMeter master is a JMeter instance which is used to direct the JMeter script to run them on agent instances.JMeter agents are also JMeter instances which are used to run JMeter scripts that direct from master.Look at the below diagram for more information.

To do above follow the below steps

  • Start JMeter in one machine and create a test plan and save.Will call this the master
  • Then go to \apache-jmeter-3.2\bin and get the jmeter.properties file.
  • Open this using a notepad and go to “Remote hosts and RMI configuration” section and add “remote_hosts=10.1.55.140,10.1.2.5” line there.Comment other remote hosts(ex: localhost).These remote hosts are the IP addresses of machines which the JMeter agents are running.
  • Now save the jmeter.properties and re-start JMeter to effect the change.
  • In agent machines, open Jmeter downloaded folder, go to bin and run “jmeter-server.bat” file.
  • Finally, go to JMeter master and run “Remote start all” under run menu.If you want to run the script in only one agent, choose Run -> Remote Start -><IP of the agent machine>.

Below image display the information in command window of JMeter agent side, when master run the script on an agent machine.

agentjm

 

How to load test a java API using JMeter

Let’s see how to perform a load test on a JAVA API.

  1. First create a JAVA API and create a .jar file.

use a random character generation function to create the java class.Follow below steps.

  • Create a class called “RandomString” and add the code below.
import java.security.SecureRandom;
public class RandomString {


         final String test = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";


        public String getRandomString(){
            SecureRandom rnd = new SecureRandom();
            int len = 10;
            StringBuilder sb = new StringBuilder(len);

            for(int i=0; i<len; i++)
                sb.append(test.charAt(rnd.nextInt(test.length())));
                return sb.toString();
        }

        public String getRandomString(int length){

            SecureRandom rnd = new SecureRandom();
            int len = length;
            StringBuilder sb = new StringBuilder(len);

            for(int i=0;i<len;i++)
                sb.append(test.charAt( rnd.nextInt(test.length())));
            return sb.toString();
        }

    }
  • Then create a main class called “TestRandomString” to execute the above class.Add the below code.
public class TestRandomString {
    public static void main(String[] args) {

        RandomString sm = new RandomString();
        System.out.println("Random String " +" "+ sm.getRandomString());
        System.out.println("Random String  "+" "+ sm.getRandomString(6));

    }

}
  • Now create a “.jar” file using above classes.
  • Then go to JMeter and  start it and create a new test plan.Add elements to it like below.

-Add a thread group to test plan

-Add a bean shell sampler to thread group

-Add a results tree listener to the thread group

sampleone

  • Browse and add the created .jar file in Test Plan.

javajar

  • Add the below code to the beanshell script

import com.lbf.qa.util.StringManager;
StringManager st = new StringManager();
System.out.println(“random string = “+” “+st.getRandomString());
System.out.println(“random string = “+” “+st.getRandomString(6));

sampletwo

  • Now adding number of threads,rampup and loop in thread group, you can run your load test on jmeter and it will show results as below in it’s command window.

The below has done for thread no=1

samplethree

How to record test cases of a web application, if you are testing behind a firewall/proxy server

Suppose, you are to test the performance of a web application which is accessible via a proxy server.And you are doing to via the recording template in JMeter.

Start JMeter in the following way.

-Open your PC’s command prompt.

-Go to the bin folder JMeter bin.

-Type jmeter.bat -H <url/ip of the web app> -P <port of the app> (ex: jmeter.bat -H 10.1.120.26 -P 4562)

-Enter.

Now the JMeter will open and select recording template and proceed with the recording as the usual way.

 

How to record test cases using JMeter

First install Java and then install JMeter.

After that open JMeter and go to File menu and select Templates

pictureone

It will add the following menu items to the Test Plan

picturetwo

 

You can record your test cases using this Test Plan.Now, Go to Workbench menu item in JMeter.

picturethree.png

Under Global settings, include the port number as any port number.(ex:8888)

Fill up the following details too.

Target Controller: Specify where you want your recordings to display.In my case i wanted them under thread group.

Grouping: I have selected “do not group samplers”. You can choose grouping your test cases since it helps you to categorize your test cases.

Leave rest of the fields to their defaults and save the script recorder.

Now go to thread group and define number of threads, loop count and ramp-up period.

In order to record your test cases you need to create a  local proxy.Therefore, define local host as a proxy in your browser settings.In my case i use chrome browser.Therefore go to it’s proxy settings and click on LAN settings.Add proxy address as “local-host” and port as the port number your specified in global settings of HTTP(S) Test Script Recorder menu item.(In my case it’s 8888).

Now you are ready to record your first test case for login function using JMeter.

In JMeter, go to HTTP test script recorder under workbench menu.And open it and Click on “Start” button.

Go to your browser and enter URL of your application.And login to your application.JMeter will record all these actions and store them under Thread Group menu.

In the results tree under work bench menu you can see all the samplers/requests that sent to the application server and their responses.

picturefour.png

 

Instead of the result tree, you can use graphs or any other listeners to check the results of your test cases.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

How to create a Batch file(.bat) using a runnable jar file in java

Let’s say that you have created some java classes via Eclipse IDE.First choose one or more classes you want to run.

Right click on a class and choose export.

login-export

Then the following window will appear and choose “Runnable JAR file” menu item.

two

Click next and following window will appear.

three

Select the class you are going to export as a runnable jar under Launch configuration drop down.

Select “Package required libraries into generated JAR” under Library handling.

Click on the browse button in the Export destination drop down and select a location to save the jar file and at the same time give a name (ex:test) for the jar file too.

four

five

Then click on finish and if you go to the location where you selected in the above dialog boxes, the jar file will be there.(ex: test.jar)

Just double click on it and it will execute your program.

Also you can execute this via a batch file.Take a notepad and write down the code below and save it as .bat extension.

start javaw -jar test.jar 

(test.jar is the name of the runnable jar file you created)

Then double click and run the batch file.It will also execute your program.

How to Overcome MYSQL installation errors

From this post I am going to tell you how to fix errors you get while installing mysql on Linux distributions.

To install mysql use sudo apt-get install mysql-server.

See whether you get an error message as below.

131217 15:59:42 [Note] Plugin ‘FEDERATED’ is disabled.
131217 15:59:42 InnoDB: The InnoDB memory heap is disabled
131217 15:59:42 InnoDB: Mutexes and rw_locks use GCC atomic builtins
131217 15:59:42 InnoDB: Compressed tables use zlib 1.2.3.4
131217 15:59:42 InnoDB: Initializing buffer pool, size = 256.0M
131217 15:59:42 InnoDB: Completed initialization of buffer pool
131217 15:59:42 InnoDB: highest supported file format is Barracuda.
131217 15:59:42 InnoDB: Waiting for the background threads to start
131217 15:59:43 InnoDB: 5.5.34 started; log sequence number 1595675
131217 15:59:43 [ERROR] /usr/sbin/mysqld: unknown variable ‘log_slow_verbosity=query_plan’
131217 15:59:43 [ERROR] Aborting

131217 15:59:43 InnoDB: Starting shutdown…
131217 15:59:44 InnoDB: Shutdown completed; log sequence number 1595675
131217 15:59:44 [Note] /usr/sbin/mysqld: Shutdown complete

start: Job failed to start
invoke-rc.d: initscript mysql, action “start” failed.
dpkg: errors were encountered while processing: mysql-server-5.5 (–configure):
podproces instalovaný post-installation skript vrátil chybový status 1
Žádné apport hlášení nebylo vytvořeno, protože již byl dosažen MaxReports
dpkg: nesplněné závislosti zamezily konfiguraci balíku mysql-server:
mysql-server závisí na mysql-server-5.5; avšak:
Balík mysql-server-5.5 zatím není zkonfigurován.
dpkg: chyba při zpracovávání mysql-server (–configure):
problém se závislostmi – nechávám nezkonfigurované
Žádné apport hlášení nebylo vytvořeno, protože již byl dosažen MaxReports
Nastavuji balík libmariadbclient18 (10.0.6+maria-1~precise) …
Zpracování spouštěčů pro balík libc-bin …
ldconfig deferred processing now taking place
Errors were encountered while processing:
mysql-server-5.5
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

To solve this follow below steps.

Go to your my.cnf file in etc or etc/mysql location.

  • type   sudo vim  /etc/mysql/my.cnf
  • comment log_slow_verbosity property.
  • Save the file and reinstall the mysql using sudo apt-get install mysql-server command.

Problem solved.. 🙂