Software Testing And Training

December 12, 2008

How to Access Command prompt from QTP

Filed under: Uncategorized — crestech @ 7:25 am

How to Access Command prompt from QTP

If You Have Any Query Please Visit UShttp://www.qacampus.com

We can even access Microsoft Windows command prompt also known as MS-DOS from QTP interface.cmd.exe is a 32-bit command prompt used in Windows NT, 2000 and XP and offers disk and file maintenance functions as well as network functions. It can be found under System32 folder.

To launch cmd.exe from QTP write :

SystemUtil.Run  “cmd.exe”, “”, “c:\WINDOWS\system32”,”open”

Once DOS window launches, this window can be leant and added to object repository

To write on command prompt window use the following code:

Window( “object class:=ConsoleWindowClass”).Type “Ping crestechsoftware.com”

Window( “object class:=ConsoleWindowClass”).Type micReturn

Using WshShell object

The WshShell object gives your scripts the ability to work with Windows shell .Your scripts can use the WshShell object to perform a number of system administration tasks, including running programs, reading from and writing to the registry, and creating shortcuts.

Following are the list of few methods used with wcript object:

1)The Environment property helps in getting  environment variables

2)The Exec method returns a WshScriptExec object, which provides status and error information about a script run with Exec along with access to the StdIn, StdOut, and StdErr channels. The Exec method allows the execution of command line applications only.

3)Pop Up Method Displays text in a pop-up message box.

4)RegRead Method helps in reading from registry

Example

The following example demonstrates the basics of the Exec method.

Dim WshShell, oExec

Set WshShell = CreateObject(”WScript.Shell”)

Set oExec = WshShell.Exec(”calc”)

Do While oExec.Status = 0

WScript.Sleep 100

Loop

WScript.Echo oExec.Status

Our Testing Partnerhttp://www.crestech.in

Descriptive Programming in QTP

Filed under: Uncategorized — crestech @ 6:08 am

Descriptive Programming in QTP

If You Have  Any Query Please Visit UShttp://www.qacampus.com

What is Descriptive Programming?

QTP can perform some action on objects at run time only when it is able to uniquely identify the object. In order to identify the object at run time (play back), QTP learns some physical properties of the object at the time of recording and stores them in object Repository (OR). When QTP runs the script, it compares these properties and values to the actual objects appearing in the application, and performs the action on the object if it finds it.

Thus, it is not possible for QTP to perform action on objects during run time if the objects are not there in OR. But descriptive programming provides a way to perform action on objects which are not in Object repository. We can instruct QTP to perform methods on the objects that are not there in object repository with the help of programmatic description or descriptive programming.

When and Why to use Descriptive programming?

When using Descriptive Programming (DP), we’re bypassing the native object repository (OR) mechanism which may have many advantages. Let’s examine the situations in which the OR’s advantages are outweighed by the DP.

Suppose we are testing the site that displays the list of users whose details matches with the search criteria that is entered in search text field. With the names, the application also displays checkboxes against each name. Now, we want to test the scenario where application sends mail to all the users whose names are displayed in the list. But we are not sure  how many check boxes will be displayed on the page as the search criteria can differ . In this situation, you can use a programmatic description to instruct QuickTest to perform a Set “ON” method for all objects that fit the description: HTML TAG = input, TYPE = check box

Our Testing Partnerhttp://www.crestech.in

December 3, 2008

A Beginner’s Blog to Performance Testing

If You Have Any Query Or Read Full Article Then Visit http://www.qacampus.com

Class 12th Board results were out and I ran to my PC to check the result. The anxiety level was rising every moment as it was taking time for the result page to open. Why is this page taking so long to open…?? Have I scored less…or perhaps I have failed in Chemistry..?? Oh god……!!!! What is going to happen… :( ?? Finally after 7 minutes and a few seconds, I rested in peace when the internet page opened and highlighted PASS on the screen. I just kicked my PC for taking the life out of me in those 7 minutes.

It’s just been a few days that I have stopped cursing my poor machine for those worst 7 minutes of my life when I came across a term called “Performance Testing”. I felt like sharing the definition of this term with you people and got up to writing this starting blog. :)

Performance testing is an emerging science in the field of Software testing. When we talk about effective development of an application that makes life easy, we cannot neglect its high performance as one of the major factors contributing to its quality. Performance testing is done to test a specific behavior of the application. But is there any specific criterion to define performance?

To define performance of any system software or any application (web/system), we can define a phrase “meeting of requirements with the timeliness” of the application. A well running application will always meet its requirements under the benchmark indicators. We map these benchmarks to the actual performance counters, which help us to judge, how the application is performing under the current environment.

Our Testing Partner – http://www.crestech.in

Blog at WordPress.com.