Monday, September 4, 2017

No PostgreSQL clusters exist; see "man pg_createcluster"

Solution :

Run commands :
dpkg-reconfigure locales

pg_createcluster 9.3 main --start
or
pg_createcluster 9.4 main --start
or
pg_createcluster 9.5 main --start
(depends on your postgresql version.)

Ubuntu Apache php error : Class 'NumberFormatter' not found

Solution :

Install Package :
apt-get install php5-intl
or
apt-get install php-intl


Make sure intl.so file is generated and it is defined as an extension in .ini file.

Tuesday, August 15, 2017

Regression testing of Web Application using Automation

Human beings try to explore new things that's why they do not want to do same work again and again. It is in their jeans, deep inside. The similar work appears monotonous for them. 

Regression testing is something that no tester wants to do and when developer tries to fix a bug and breaks a functionality which was working absolutely fine before, this condition disturbs a tester psychologically. It increases irritation and makes a tester annoyed, impatient and angry.

But for automation, it is a different story. The tools do not feel bad if you assign them same task again and again. That's why a script is a best friend of a tester whose work is regression.

If you want to do automation testing, the first tool comes in mind is Selenium. Definitely it gives the result efficiently and it is quite flawless. Big companies are using it as their primary testing tool and testers who are seeking good career opportunities are trying to learn it as fast as possible but it is not the only tool which can give you automation results.

Today I am going to discuss two less used web application automation test tools.

First is CURL yes you heard right, I am not joking. If you enjoy working on terminal and you like scripting, curl is one of the best tool to achieve regression testing task. It is so efficient that hacker started using to manipulate data that's why many big sites have blocked it.

How to do regression testing using CURL
1. Create a curl command for login or registration what you want to test by passing valid data with valid method like POST or GET.
If your form uses cookies, you can save and reuse again in CURL.

Example :
curl -c cookie.txt -d "LoginName=someuser" -d "password=somepass" https://oursite/a 

curl -b cookie.txt https://oursite/myaccount


2. You can use this command in BASH script and after running the script new user will be registered or existing user will be logged in successfully.

3. You can achieve login protected task like edit profile, create category, edit tasks, schedule tasks using CURL. You need to make script for each task and while regression, you do not need to do it again and again manually

A failed script is enough to notify that functionality is broken. Not only it will be efficient but it will save your time too.

Second one is JMETER. You must be thinking that we are not talking about performance testing, first we should achieve a working functionality. You can use JMETER for functionality testing too. It has a UI interface so it is quite easier than CURL.

How to do regression testing using JMETER
1. Record a script of functionality like login or registration.
2. Save the test plan as .jmx file 
Now this is a script which you can use in regression testing.

Jmeter has cookie manager using it you can achieve cookie based login to test login protected functionlity. Using regular expression extractor, you can test CSRF based login functionality or pass dynamic values by storing them in variables. Using csv set config, you can run data driven tests as well as parametrization can be done. Not only REST API and LDAP tasks but you can perform all types of java based web application functionality testing tasks.

This is very little that I have listed advantages of JMETER, once you start using it, you will come to know that it is fine tool to perform regression testing. 

Tutorials to Learn Jmeter : 
https://www.youtube.com/watch?v=f6AvTKLrD8A
https://www.youtube.com/watch?v=KgKtM48ujxQ
https://www.youtube.com/watch?v=LLTZG6tbyC8
https://www.youtube.com/watch?v=EdABL-1Z1qU
https://www.youtube.com/watch?v=hlnjD650oMY