Efficient TestCase for QA With Testing Template

Why need Testcases ?

Test case is a set of conditions under which a tester will determine whether an application or software system or one of its features is working as expected.’

Let’s discuss About the – TestCases

If the test cases are ready, they are really helpful to measure weather client expectations were fulfilled or not.

Demo
Website – https://tpromode.github.io/qa/
Temaplet at : https://goo.gl/SRSjFy

685 total views, 3 views today

 

API Testing – Running Postman collection in the Docker

Most of the time people have the issue with installing software and dependencies. For example, we want to

Schedule the collection of the postman that we have created earlier using ‘POSTMAN’ tool, Rather than installing ‘newman’ command line tool, We will use a Docker image of Linux box with already installed ‘newman’.

I have been asked why I am getting the error, ‘newman’ not working etc, my os/system is having an issue while installing or running. This post definitely help you guys.


Understanding docker

Docker allows you to package an application with all of its dependencies into a standardized unit for software development.

In simple sentence consider it as a virtual machine which has ubuntu running with ‘newman‘ installed already.

Installing docker.

Navigate to the https://www.docker.com/products/overview#/install_the_platform. And Install it.
When you run it this is how it look like in Mac.

 

 

 

 

 

Pulling the docker images(Make sure you have the Docker install and started it)

  • docker pull postman/newman_ubuntu1404

Running postman collection using docker Command-line.

  •  docker run t postman/newman_ubuntu1404 url=“https://www.getpostman.com/collections/8a0c9bc08f062d12dcda”

Getting results.

 

 

How to test Cron Job(Cron job testing)


What is Cron Job ?

The software utility Cron is a time-based job scheduler in Unix-like computer operating systems. People who set up and maintain software environments use cron to schedule jobs (commands or shell scripts) to run periodically at fixed times, dates, or intervals.

 

Below are the few points/Pre-made Test cases for the Cron Job Testing:-

  1. Verify if It is scheduled correctly – By going here http://corntab.com/.
  2. Mock the Cron time by 1-2 minutes by changing it for quick testing (if it’s long for hour/day long). – High
  3. Ask the devs to create a shortcut for it. In the server or any other way to directly run it by you so that you can test it when you need.(saves time)
  4. Ask dev to add the logs for monitor purpose and monitor it while testing.
    Use below command for logs.
    * * * * * /path/script.sh &> /path/script.log or
    tail -f /var/log/cron
  5. Do testing by doing changing things like we do in CRUD(Not always, Crud means update/delete etc whichever is relevant) and verify results. – High
  6. Break something the job relies on upon and schedule it to run again in a few minutes – Verify the results.
  7. After deployment – Validate it with real data also. – High
  8. Keep system time and user system time in mind while testing CRON’s as scheduling is by server GMT time usually.
  9. Negative scenario: What if CRON is stopped the midway execution, any impacts it will have?
  10. Negative – Discuss with dev if there is any possibility of the same Cron getting run multiple times.
  11. Negative – Discuss with dev if its fails to the job – What is the risk/ solution for it(did we get the mail if it fails ?)
  12. Test for scenarios which shouldn’t get affected by Cron job(e.g. a other Cron should not affect other cron)


This is sample Cron job template in crontab

Hello.py:

 

API Testing using POSTMAN – Advance Test Cases

In this tutorial, We are going to write some TESTCASES in the POSTMAN Chrome as a part of API Testing.

API Testing includes

1. JSON Schema Validation
2. Response Time Verification
3. Verification of the Keys defined in response by API
4. Values as Expected (Data driven Testing) in response

Learn about JSON Schema – http://jsonschema.net

 

Code  – 
URL –  https://jsonplaceholder.typicode.com/posts/1

Test Code  –

 

 

 

Testing Techniques -Pairwise Testing using Pairwiser Tool

Today I am going to discuss Testing Techniques- Pairwise Testing.  “Generate less number of combination with more test coverage.

What is Pairwise Technique?

  • A black-box test design technique in which test cases are designed to execute all possible discrete combinations of each pair of input parameters
  • Pairwise testing technique can dramatically reduce the number of combinations to be covered but remains very effective in terms of fault detection

Now let’s learn how to apply Pairwise Testing by this example.

Let’s take an example –
Suppose, we have a web app with one page that we have to do the Cross browser testing (CBT) e.g for IE, Chrome, Firefox, Opera, Safari and Cross OS testing with Windows, Mac, Ubuntu. We have another parameter like HTTP 1, HTTP 2 and resolution HD, NonHD(low resolution).

So Normal combination  – 5*3*2*2 = 60
To perform 60 Test cases we will need about  180 minutes(assuming 3 minutes per Test Case).

Let’s take this example in the Pairwise Testing.

We will use the Pairwiser-tool for combination to generate.

Need for Pairwiser tool

  1. Web-based easy to use.
  2. Generate the combination and export to excel.
  3. Generate the Test case and export to JIRA directly.
  4. You can apply the constraint to the input parameter.

Input in the Pairwiser Tool

  • Input 1 – CBT  : IE, Chrome , Firefox , Safari , Opera
  • Input 2 – Cross OS: Windows, Mac OSX, Ubuntu
  • Input 3 – Protocol : HTTP1 , HTTP2
  • Input 4 – Resolution:  HD, NonHD

Create a New Test Plan in – https://inductive.no/pairwiser-tool/

Create Test PLAN

Added input Parameters and Constraints

More IE – Constraints

Navigate to Generate Test Case – Only 15 Test Cases  \m/ 🙂

Time in Test Cases Now

Test Cases  = 15
Time per Test  = 3 minutes

Total  Time  = 45 Minutes only before it was 3 hour

Lets Analysis the coverage, the Results

Test Cases Generation – Template

Test Cases – Copy to JIRA or Excel

That’s All Folks

In the Form of Slides