Tuesday, October 19, 2010

QTP Script For Connecting to Database

QTP Script for connecting to MS Access.

Option Explicit
Dim con,rs
Set con=createobject("adodb.connection")
Set rs=createobject("adodb.recordset")
 con.provider="microsoft.jet.oledb.4.0"
 con.open"d:testdata.mdb"
 rs.open"select*from emp",con
Do while not rs.eof
VbWindow("Form1").VbEdit("val1").Set rs.fields("v1")
VbWindow("Form1").VbEdit("val2").Set rs.fields("v2")
VbWindow("Form1").VbButton("ADD").Click
rs.movenext Loop
The database we are using here is MS Access.Before running this script create a table in MS Acess.
 In the above script I used table called "emp" and column names as "v1" and "v2". "d:testdata.mdb" is path of the table which we created. The main use of this script is to use testdata of table(which is in database) in the application. In the above script we are passing values from database to Textboxes in Windows Application.

Similarly script for connecting to other 2 databases are

 QTP Script for connecting to sqlserver.

Option Explicit
 Dim con,rs
Set con=createobject("adodb.connection")
Set rs=createobject("adodb.recordset") con.open"provider=sqloledb.1;server=localhost;uid=sa;pwd=;database=testdata"
rs.open"select*from emp",con
Do while not rs.eof
VbWindow("Form1").VbEdit("val1").Set rs.fields("v1")
VbWindow("Form1").VbEdit("val2").Set rs.fields("v2")
VbWindow("Form1").VbButton("ADD").Click
 rs.movenext
 Loop

Script for connecting to oracle

Option Explicit
Dim con,rs
Set con=createobject("adodb.connection")
Set rs=createobject("adodb.recordset")
con.open"provider=oraoledb.1;server=localhost; uid=scott;pwd=tiger;database=testdata" rs.open"select*from emp",con
Do while not rs.eof
VbWindow("Form1").VbEdit("val1").Set rs.fields("v1")
VbWindow("Form1").VbEdit("val2").Set rs.fields("v2")
VbWindow("Form1").VbButton("ADD").Click
rs.movenext
Loop
This is the way u connect to database in QTP and get the values from database.

Saturday, October 16, 2010

Vbscript Advanced Tutorial

Vbscript Advanced Tutorial#1



Vbscript Advanced Tutorial#2

VB Script Video Tutorial Series

VBScript Tutorial 1-Overview and Output



VBScript Tutorial 2 - Variables and Arrays



VBScript Tutorial 3 - Conditional Statements



VBScript Tutorial 4 - Loops



VBScript Tutorial 5 - Procedures



VBScript tutorial 6- Replace and Round



VBScript tutorial 7- Return and Random



VBScript tutorial 8- Case, Trim , and Reverse




Saturday, October 9, 2010

Characteristics of Good Testers

Is inquisitive

Has functional/business knowledge

Is detail-oriented

Is open-minded

Has a good personality

Has a technical background, but does not want to be a programmer

Has testing experience

Is a team player

Is flexible

Is self-reliant

Is self-starting

Has a positive attitude

Is logical

Handles stress well

Is a quick thinker

Knows specific tools

Has good common sense

Is politically astute

Has a sense of humor

Understands the software development lifecycle

Levels (Stages) of Test Planning


Levels (Stages) of Test Planning
Test planning can and should occur at several levels or stages. The first plan to consider is the Master Test Plan (MTP), which can be a separate document or could be included as part of the project plan. The purpose of the MTP is to orchestrate testing at all levels. The IEEE Std. 829-1998 Standard for Software Test Documentation identifies the following levels of test: Unit, Integration, System, and Acceptance. Other organizations may use more or less than four levels and possibly use different names. Some other levels (or at least other names) that we frequently encounter include beta, alpha, customer acceptance, user acceptance, build, string, and development. In this book, we will use the four levels identified in the IEEE and illustrated in figure 3-1.




Figure 3-1: Levels of Test Planning
Key Point Test planning CAN'T be separated from project planning.
All important test planning issues are also important project planning issues.
The test manager should think of the Master Test Plan as one of his or her major communication channels with all project participants. Test planning is a process that ultimately leads to a document that allows all parties involved in the testing process to proactively decide what the important issues are in testing and how to best deal with these issues. The goal of test planning is not to create a long list of test cases, but rather to deal with the important issues of testing strategy, resource utilization, responsibilities, risks, and priorities.
Key Point Test planning SHOULD be separated from test design.
In test planning, even though the document is important, the process is ultimately more important than the document. Discussing issues of what and how to test early in the project lifecycle can save a lot of time, money, and disagreement later. Case Study 3-1 describes how one company derived a great benefit from their Master Test Plan, even though it was never actually used.
Case Study 3-1: If the Master Test Plan was so great, why didn't they use it?


The "Best" Test Plan We Ever Wrote
I once had a consulting assignment at a major American company where I was supposed to help them create their first ever Master Test Plan. Following up with the client a few months later, the project manager told me that the creation of the Master Test Plan had contributed significantly to the success of the project, but unfortunately they hadn't really followed the plan or kept it up to date. I replied, "Let me get this straight. You didn't use the plan, but you felt that it was a major contributor to your success. Please explain." The project manager told me that when they began to fall behind, they dispensed with much of the project documentation, including the test plan (sound familiar?). But because they created the plan early in the project lifecycle, many testing issues were raised that normally weren't considered until it was too late to take action. The planning process also heightened the awareness of the importance of testing to all of the project participants. Now, I believe that keeping test plans up to date is important, so that's not the purpose of telling you this story. Rather, I'm trying to stress the importance of the testing process, not just the document.
— Rick Craig



Key Point "We should think of planning as a learning process - as mental preparation which improves our understanding of a situation… Planning is thinking before doing."
- Planning, MCDP5 U.S. Marine Corps
Key Point Ike said it best: "The plan is nothing, the planning is everything."
- Dwight D. Eisenhower
In addition to the Master Test Plan, it is often necessary to create detailed or level-specific test plans. On a larger or more complex project, it's often worthwhile to create an Acceptance Test Plan, System Test Plan, Integration Test Plan, Unit Test Plan, and other test plans, depending on the scope of your project. Smaller projects, that is, projects with smaller scope, number of participants, and organizations, may find that they only need one test plan, which will cover all levels of test. Deciding the number and scope of test plans required should be one of the first strategy decisions made in test planning. As the complexity of a testing activity increases, the criticality of having a good Master Test Plan increases exponentially, as illustrated in Figure 3-2.

Figure 3-2: Importance of Test Planning