Thursday, July 21, 2016

ETL Testing concepts

When we are talking about ETL testing , we should must remember there is change the data location(upgrade).

Over a period of time generally companies will change data ware house and they will upgrade it, so they should also check whether the new database as per the mark and underline the process.

Ex: when we are shifting our home from one location(Old House) to another location (new house)  basically we will remember below things

1) New house will be as per our requirements
2) The goods which we have in old his will be rearranged and all the required goods will fit well,
3) The goods which are no longer required will be deleted permanently.
4) New goods which required as per the additions should be fit correctly.
5) While transporting the goods should be careful(transaction rules) If there are any glass items

and the first basic thing is....

1) Need to pack all the goods (Extract)
2) Do the transportation to the new house (Transform)
3) Arrange the goods in a proper, which should fit with new house (Load)

.

Thursday, October 8, 2015

SQL For Beginner

SQL is a structured query language will helps to storing , Retrieving and Manipulating the data stored in data base

Data base is a Structured Set of data stored in computer, Which can be accessible in many ways
The below operations can be performed on database
1. CREATE DATA BASE
2. DROP DATA BASE
3.RENAME DATABASE
4.SELECT DATABASE

Please remember that data should exist in the database in order to retrieve or modify the data, Hence our first and fore most thing is creating Data in the database
CREATE DATABASE: Create data base is used data in data base such way that can be reuseful in future
 Create DATA BASE statenment is used by the developer to store the data by creating Tables, Rows and Columns



















Saturday, October 19, 2013

Important concepts in load runner scripting

To perfect in loadrunner scripting please go through with the below concepts .
Guide lines for performance scripting.
1) Under stand the  HTTP Request and Response.
2)  Record the script in Action Method.
3) disable all the script level properties.
4) Always better to record the script in HTML page with 'A script containing explicit URL only' by selecting this option under Advance HTML.
5) Always enable "Generate web_reg_find function for page titles" in advance properties.
6) Select "Enable the correlation during recording" option in correlation properties if you want to do automatic correlation.
7) Insert the transaction points for each page request to measure the response time.

HTTP Request and Response:

First need to understand the request and response  from client to server.
An HTTP request will be sent from browser to server.
Generally most useful methods in loadrunner are get and post

Get method :
Get method is used to Requests data from a specified resource

Example :accessing gmail application from browser,every one will have the same login page and we will get that using Get method

Post Method:
post method Submits data to be processed to a specified resource

Example :The transaction id generating from server which is different for every user and we can get from Post method.

In loadrunner get method is replaced with web_url and Post method is replaced with web_submit_data


There are different tools available in the market to analyze the HTTP traffic, those are
1) Firefox-HTTPfox
2) IE-HTTPwatch
3) Fiddler and etc..

Record the script in Action Method:
Record the script in Action Method including login and logout for quick recording later if we want we can split the login and logout  functions in other block  and we can call  those functions wherever required.

Disable the script level properties:

I will update the steps to right load runner script manually without recording

Transaction Points:










Thursday, October 3, 2013

Start Learning Load Runner

Load Runner is performance tool best suitable for maximum no.of protocols.
current version is 11.5 Owned by HP and called as HP load runner and prior to this it is with mercury.

Components of Load Runner:
1) Virtual User Generator
2) Load Generator 
3) Controller
4) Analysis

 Virtual User Generator :
Component is used to develop and customize the Vuser script based upon identified business scenario.
and based on identified scenario we will generate vuser's script and also costomize it with all the scripting scenario standard's to make sure the script will reply according to the vuser's behavior.
Installation file for vugen is vugen.exe

Controller :
This component is used to organize, drive, manage, and also monitor the multiple user test scenario as per the plan.
Installation file for controller is wlrun.exe and windows flavor supported

Analysis:
This  component is used to view, compare and analyze the result with graphs and statistical summery report.we can analize based on SLA's which have.
All the flavors of windows and Linux will be supported

Agent Process:
It is communicator between load generator and load controller.
Installation file for agent process is magentproc.exe.
All the flavors of windows, Linux  and Unix.

Note:
When we install agent process in machine then  that machine will acts like load generator.

Load Generator:
Will generator will generate the amount of load (virtual users ) and will hit the server.


Protocol adviser:
A Newly add feature available from LR 9.5 version and it detects the best suitable protocol to automate the script.

Usage
By selecting protocol adviser navigate any on of the end to end business scenario.this way the protocol adviser will walk through application communication and development technologies and identifies the supported protocols.
But Prior to this thing need to be done manually.

Load runner testing process:
Below are the steps involved in load runner testing process
1) Plan the load test
2) Convert business scenario into vusers script
3) Define the scenario
4) Execute/Run the defined scenario
5) Analyze the scenario.

In stall load runner trail version in your machine to start learning the script.
Options and steps while doing scripting

generally script is divided in to 3 parts:

1) vuser init():
2) Action();
3) vuser end();









Tuesday, October 1, 2013

Basic Load Runner functions

Below are few frequently used LR functions

1) lr_ouput_message()
2)  lr_message()
3) lr_error_message()
4) lr_log_message()
5) lr_save_datetime()
6) lr_save_string()
7) lr_save_int()
8) lr_eval_string

LR_OUTPUT_MESSAGE()
This function is used to display the  message in an output window.

Example program to demonstrate

Action()
{
lr_output_message("Welcome to load runner")
}

Output: Action.(3):Welcome to load runner

Note:-If u want to see only message without logs then go to Run Time Settings and disable logs

To display the message (which is stored in a variable)
Action()
{
char *temp="Hyderabad";

lr_output_message("%s",temp);
return 0;
}

Output:Action.(5):Welcome to load runner

Note:- If u want to ignore the line numbers then use lr_message instead of lr_output_message

Action()
{
char *temp="Hyderabad";

lr_message("%s",temp);
return 0;
}
Output:Welcome to load runner

LR_LOG_Message():-
This function is used to display a log message .It will writes the log message in to log file.

Action()
{
char *temp="Hyderabad";

lr_log_message("%s",temp);
return 0;
}
Output:Welcome to load runner

Note: To enable logs go to Run Time Settings and enable logs and log messages will be saved into log file during the test execution in controller.

LR_SAVE_DATETIME():
It captures and saves the system's current date and time.
below are the few keywords which are used in lr_save_datetime

a----------------------------------->day with a part of name
A---------------------------------->Full name of the day.
b----------------------------------->name of the month(only a part of the month name)
B----------------------------------->Full name of the month
#----------------------------------->Will ignores 0 in the month
%d--------------------------------->To display the day in digits
%m--------------------------------->To display the month in digits
%M--------------------------------->To display the minutes
%y----------------------------------->displays year but contains only 2 digits
%Y---------------------------------->displays year but contains 4 digits
%c-----------------------------------> system current time along with time
date_now
A system keyword to captures the today's date

Action()
{
lr_save_datetime("%c",date_now,"abc");
lr_output_message(lr_eval_string("{abc}"));
return 0;
}

LR_SAVE_STRING():
This function is used to save the string value into another string variable

Action()
{
lr_save_string("welcome to load runner","abc");
lr_output_message(lr_eval_string("{abc}"));
return 0;
}

Action()
{
char *temp="welcome to load runner";
lr_save_string(temp,"abc");
lr_output_message(lr_eval_string("{abc}"));
return 0;
}

Note:
lr_save_string canot save the int values in to string variable

LR_SAVE_INT():
This function is used to save the int value into another string variable

Action()
{
lr_save_int(1213123,"abc");
lr_output_message(lr_eval_string("{abc}"));
return 0;
}

Action()
{
int i=1213123;
lr_save_int(i,"abc");
lr_output_message(lr_eval_string("{abc}"));
return 0;
}

Note:
lr_save_string canot save the int values in to string variable

Monday, September 30, 2013

Few file Operation used in C language

File Operations:
Below are the few file operations which we perform generally

1) Crete,Read, Write, Open and Close
Note: Other than .pdf we can create .txt, csc, .doc , .xls, .dat

Create a file and write data into that file:
Action();
{
char *file1 = D:\\madhu\\sample.txt;
long filename1;
filename1=fopen(file1,"w")--------->W is used to write data into file and R is used to Read.
fprintf(filename1,"%s","Welcome To Load Runner");-->fprintf is used to enter some text into a file
fclose(filename1);--->flose is used to close the opened fie
return 0;
}
Write Some Random Numbers into a file:
Action();
{
char *file1 = D:\\madhu\\sample.txt;
long filename1;
int a=rand()%11+10;
filename1=fopen(file1,"w")--------->W is used to write data into file and R is used to Read.
fprintf(filename1,"%d\n",a);
fclose(filename1);
return 0;
}

Read data from an existing file:

Read data in a file as string wise using common separator
Action();
{
char *file1 = D:\\madhu\\sample.txt;
long filename1;
char s1[100],s2[100],s3[100],s4[100];
int d;
filename1=fopen(file1,"w")--------->W is used to write data into file and R is used to Read.
fprintf(filename1,"%s","Welcome To Load Runner performance testing version 1")
filename1=fopen(file1,"r")--------->W is used to write data into file and R is used to Read.
fscanf(filename1,"%s1",&s1);
fscanf(filename1,"%s2",&s2);
fscanf(filename1,"%s3",&s3);
fscanf(filename1,"%s4",&s4);
fscanf(filename1,"%d",&d);
lr_output_message("%s %s %s %s ",&s1,&s2,&s3,&s4);
lr_output_message("%d ",&d);
fclose(filename1);
return 0;
}

Read data in a file as line wise :

Action();
{
char *file1 = D:\\madhu\\sample.txt;
long filename1;
char temp[100];
filename1=fopen(file1,"w")--------->W is used to write data into file and R is used to Read.
fprintf(filename1,"%s","Welcome To Load Runner performance testing version 1");
filename1=fopen(file1,"r")--------->W is used to write data into file and R is used to Read.
fgets(temp,200,filename1);
fclose(filename1);--->flose is used to close the opened fie
return 0;
}

To Read size of characters in file 

Action();
{
char *file1 = D:\\madhu\\sample.txt;
long filename1;
char temp[100];
int total=0;count;
char buffer[1000];
filename1=fopen(file1,"w")--------->W is used to write data into file and R is used to Read.
fprintf(filename1,"%s","Welcome To Load Runner performance testing version 1");
filename1=fopen(file1,"r")--------->W is used to write data into file and R is used to Read.
while(!feof(filename1))
{
count=fread(buffer,sizeof(char),1000,filename1);
total +=count;
}
lr_output_message("total number of  bytes=%d ",total);
fclose(filename1);--->flose is used to close the opened fie
return 0;
}

Total no.of characters of a file :

Action();
{
char *file1 = D:\\madhu\\sample.txt;
long filename1;
char temp[100];
filename1=fopen(file1,"w")--------->W is used to write data into file and R is used to Read.
fprintf(filename1,"%s","Welcome To Load Runner performance testing version 1");
fprintf(filename1,"%s","Welcome To Load Runner performance testing version 2");
fprintf(filename1,"%s","Welcome To Load Runner performance testing version 3");
filename1=fopen(file1,"r")--------->W is used to write data into file and R is used to Read.
while(!feof(filename1))
{
lr_output_message("%s ",temp);
fgets(temp,1000,filename1);
}
fclose(filename1);--->flose is used to close the opened fie
return 0;
}

Few string Oprations used in C language

below are various types of string functions which are used in Load Runner
1) Strlen();
2) strcpy();
3) strcat();
4) strcmp()
5) stricmp()
6) Strncmp();
7) Sprintf();
8) Strtok();
9) Conversion Functions

STRLEN();
This Function is used find the length of a given string.

Action()
{
int a,b;
char *temp ="Welcome To Load Runner";
a=strlen("Welcome To Load Runner");
b=strlen(temp);
lr_output_message("%d",&a);
lr_output_message("%d",&b);
return 0;
}

STRCPY();
This Function used to copy the whole string into another string

1) By storing  the value in to another variable

Action()
{
char temp2[100];
char *temp1 ="Welcome To Load Runner";
strcpy(temp2,temp1);
lr_output_message("%s",temp1);
lr_output_message("%s",temp2);
return 0;

}

with out storing  the value in to another variable

Action()
{
char temp2[100];
char *temp1 ="Welcome To Load Runner";
strcpy(temp2,temp1);
lr_output_message("%s",temp1);
lr_output_message("%s",temp2);
return 0;

}

STRCAT();
This function is used to concatenates two strings,the second string will appended to first string.

Action()
{
char temp[100];
strcpy(temp,"welcome to load runner");
strcat(temp,"performance tool");
lr_output_message("%s",temp);
return 0;

}

Action()
{
char temp3[100];
char *temp1="welcome to load runner";
char *temp2='Performance Tool';
strcat(temp3,temp1);
strcat(temp3,temp2);
lr_output_message("%s",temp3);
return 0;

}

STRTOK();
This is function is used to split the string to into no.of sub strings using a common deliminator or separator.

Action()
{
char *temp2[]="welcome to load runner";
char *token;
token=(char *)strtok(temp2," ");

while(token!=NULL)
{
lr_output_message("%s",token);
token=(char *)strtok(NULL,"");
}
return 0;
}

STRCMP();
This function is used to compare the strings,strings will be compared based on their ASCII values and
-> If both the strings are equal then it returns 0;
-> If first string is greater then the second string then it will returns 1
-> If second string is greater then the first string then it will returns -1

Action()
{
int a,b,c;
a=strcmp(Hyderabad,Bangalore);
b=strcmp(Hyderabad,Hangalore);
c=strcmp(Hyderabad,Hyderabad);
lr_output_message("%d",&a);
lr_output_message("%d",&b);
lr_output_message("%d",&c);
return 0;
}

STRICMP();
This function is used to ignore the cases and treats the upper case and lower case letters same.

Action()
{
int a;
a=stricmp(Hyderabad,HYDERBAD);
lr_output_message("%d",&a);
return 0;
}


STRNCMP();
This function will compare the strings and if they are not equal then it will returns ASCII code deference value between them.

Action()
{
int a;
a=strncmp(Hyderabad,HYDERBAD);
lr_output_message("%d",&a);
return 0;

}

SPRINTF(); 
This function is used to print and save any given formatted data into a string variable.

Action()
{
char a[100];
sprintf(a,"%s","welcome to load runner");
lr_output_message("%s",&a);
return 0;

}

Conversion Functions:

A To I:
This function is used to Converts a string formatted integer value into pure integer value.

I TO A
This function is used to Converts a integer formatted string value into pure string value.

A To F:
This function is used to Converts a string formatted float value into Float value.

A To F:
This function is used to Converts a string formatted Long value into Long value.