Stmlabexperiments 1 - 11
Stmlabexperiments 1 - 11
LAB MANUAL
Regulation : R18
Branch : B.TECH. – IT
Year & Semester : III Year / II Semester
1. Context Sensitive
2. Analog.
1. Context Sensitive
Context Sensitive mode records the operations in terms of the GUI objects in application.
WinRunner identifies each object we click (such as a window, menu, list, or button), and the type
of operation we perform (such as press, enable, move, or select).
For example, if we record a mouse click on the OK button in the Flight Reservation Login
window, WinRunner records the following TSL statement in test script:
button_press ("OK");
When we run the script, WinRunner reads the command, looks for the OK
button, and presses it.
2. Analog
In Analog mode, WinRunner records the exact coordinates traveled by the mouse,as well as
mouse clicks and keyboard input. For example, if you click the OK buttonin the Login window,
WinRunner records statements that look like this:
Recorded statements meaning...
move_locator_track (1); mouse track
mtype ("<T110><kLeft>-"); left mouse button press
mtype ("<kLeft>+"); left mouse button release
When we run the test, WinRunner retraces the recorded movements using absolute screen
coordinates. Recording in Analog mode should be done only when exact mouse movements are
an important part of test
Procedure:
Recording in Context Sensitive Mode:
Here we will create a script that tests the process of opening an order in the Flight Reservation
application. A script is created by recording in Context Sensitive mode.
Steps:
1.Open WinRunner. -Choose Programs > WinRunner > WinRunner on the Start menu.
2 Create a new test. Choose File > New. A new test window opens in WinRunner.
3 Start the Flight Reservation application and log in.
Choose Programs > WinRunner > Sample Applications > Flight 1A on the Startmenu.
In the Login window, type your name and the password as mercury, and clickOK.
4. Start recording in Context Sensitive mode. Choose Create > Record—Context Sensitive
5.Open order #3. In the Flight Reservation application, choose File > Open Order.
In the Open Order dialog box, select the Order No. check box. Type 3 in the adjacent box, and
click OK.
Output:
Recording in Context Sensitive Mode
WinRunner Tool and Flight Reservation Application opened
Selecting Record in Context Sensitive Mode using WinRunner tool
Test Script is generated in WinRunner when the Flight Reservation window is moved and open
order is selected
Selecting order no 3 in open order window and clicking ok, test script is generated in winrunner
Theory:
Behaviour of Graphical User Interface objects in an application are verified by GUI checkpoints using
wnrunner tool.A GUI checkpoint examinesthe behavior of an object’s properties.
Procedure:
Use the pointer to double-click the Order No. check box. The Check GUI dialogbox opens and
displays the available checks.
6. Stop recording
GUI checkpoints appear as obj_check_gui and win_check_gui statements inthe test script.
Output:
Order No check box property is examined and select paste to insert the details in test script
GUI checkpoint for Order No Check box property is created in test script
Result : GUI Checkpoint for Single property of an object is created and verified successfully
Experiment-3: GUI Checkpoint for Single Object/Window
Theory:
Behaviour of Graphical User Interface objects in an application are verified by GUI checkpoints using
WinRunner tool.A GUI checkpoint examinesthe behavior of an object’s properties
Check GUI dialog box opens on double clicking the Order No check box
On clicking OK ,GUI checkpoint is created and inserted in test script
Theory:
Behaviour of Graphical User Interface objects in an application are verified by GUI checkpoints using
WinRunner tool.A GUI checkpoint examinesthe behavior of an object’s properties
Opening Order 4
Stop recording and Saving test
Test Result
Result: GUI Checkpoint for Multiple Objects have been created successfully
Experiment-5:
Theory:
If an application contains bitmap areas, such as drawings or graphs, we can check these areas
using a bitmap checkpoint.A bitmap checkpoint comparescaptured bitmap images pixel by pixel.
Procedure:
Here we will test the Agent Signature box in the Fax Order dialog box. We will use a bitmap
checkpoint to check that we can sign name in the box.Then we will use another bitmap
checkpoint to check that the box clears when we click the Clear Signature button.
Steps:
1 Start WinRunner and open a new test.
2 Start the Flight Reservation application and log in.
3 Start recording in Context Sensitive mode.
4 Open order #6.
5 Open the Fax Order dialog box.
6 Enter a 10-digit fax number in the Fax Number box.
7 Move the Fax Order dialog box.
8 Switch to Analog mode.
9 Sign your name in the Agent Signature box.
10 Switch back to Context Sensitive mode.
11 Insert a bitmap checkpoint that checks your signature.
12 Click the Clear Signature button.
13 Insert another bitmap checkpoint that checks the Agent Signature box.
14 Click the Cancel button on the Fax Order dialog box.
15 Stop recording.
16 Save the test.
Run the Test on new version of Application
1. Make sure the above saved test is open ,open flight_1B application & login
2 In WinRunner, check that Verify mode is selected in the Standard toolbar.
3.Choose Run > Run from Top,
4. The Run Test dialog box opens. Accept the default test run name “res1.”
Run the test Click OK in the Run Test dialog box.
5. Review the results.
Output:
Opening order 6 in Flight Reservation window
Open Fax Order Dialog box, enter fax number, move the fax order dialog box
Switching to Analog Mode
Next, double-click the second “capture bitmap”event, or select it and click the Display button
Running Test on New Version Flight 1b application
The test failedbecause theAgent Signaturefield did not clearwhen WinRunnerclicked the
ClearSignature button during the run of the test
Test Results-Expected, Actual and Difference results
Steps:
Test Results
Test Results- Expected , Actual , Difference results
Result: Bit map checkpoints for Object and Screen Area are successfully created.
Experiment-6: Database Checkpoint for default check
Theory:
Database checkpoints can be used in the test scripts to check databases of application and the defects can
be traced. In this process, define a query on the database and then create a database checkpoint that
checks the properties of the results of the query. When checking these properties, we can check the
contents of the results or how many rows or columns the results contain.
In the default check, the query has to be manually defined and the properties we want to test cannot be
specified.
Procedure:
To create database checkpoint for default check
Choose Create> Database Checkpoint > Default Check Steps:
Steps
1 Start WinRunner and open a new test.
2 Start recording in Context Sensitive mode.
3 Choose Create> Database Checkpoint > Default Check
4 If Microsoft Query is installed and you are creating a new query, an instruction screen opens
for creating a query. Click OK to close the instruction screen.
If Microsoft Query is not installed, the Database Checkpoint wizard opens to a screen where
you can define the ODBC query manually.
5. Define a query, copy a query, or specify an SQL statement
6. WinRunner takes several seconds to capture the database query and restore the WinRunner
window.
7. Stop recording in context sensitive mode
8. Save the test and run the test to view test results.
WinRunner captures the data specified by the query and stores it in the test’s exp folder.
WinRunner creates the msqr*.sql query file and stores it and the database checklist in the test’s
chklist folder.
A database checkpoint is inserted in the test script as a db_check statement.
Output:
Recording test in Context Sensitive mode
Querying database
Database checkpoint is create in the test script
Theory:
In custom check, we can create a database checkpoint where we can specify which properties to check on
a result set. Different operations can be done on a database by the custom check like:
Check the contents of the part or the entire result set.
Edit the expected results of the contents of the result set
Count the rows in the result set
Count the columns in the result set.
Procedure:
To create database checkpoint for default check
Choose Create> Database Checkpoint >Custom check
Steps
1 Start WinRunner and open a new test.
2 Start recording in Context Sensitive mode.
3 Choose Create> Database Checkpoint >Custom Check
4 If Microsoft Query is installed and you are creating a new query, an instruction screen opens
for creating a query. Click OK to close the instruction screen.
If Microsoft Query is not installed, the Database Checkpoint wizard opens to a screen where
you can define the ODBC query manually.
5. Define a query, copy a query, or specify an SQL statement
6. WinRunner takes several seconds to capture the database query and restore the WinRunner
window.
7. Stop recording in context sensitive mode
8. Save the test and run the test to view test results.
Output:
Creating Database checkpoint for Custom check
Querying database
Theory:
A runtime database record checkpoint is created to compare information displayed in the application
during a test run with the current value(s) in the corresponding record(s) in a database.
Runtime database record checkpoints are added by running the Runtime Record Checkpoint wizard.
When finished, the wizard inserts the appropriate db_record_check statement into test script.
The Runtime Record Checkpoint wizard guides through the steps of defining the query,
identifying the application controls that contain the information corresponding to the records in
the query, and defining the success criteria for the checkpoint
Procedure
To create database checkpoint for runtime check
Choose Create> Database Checkpoint >runtime record check
Steps
1Start WinRunner, Create new test
2. Open flight reservation application and login.
3 In WinRunner, Start recording in Context Sensitive mode.
4. In flight reservation application, select open order from File menu and type order no as 6,
click ok
5. In Win runner Choose Create> Database Checkpoint >runtime record check
6.Select specify SQL statement form Runtime record checkpoint wizard and click next.
7. Create specify the connection string and specify sql query and click next.
8. Map the database column field names with the field values in the application window using
the hand pointer tool
9. Select the option one or more matching records.
9. Click finish to create the database runtime record checkpoint.
10. Stop recording and save the test.
11. Run the test and view the results.
Output:
Order 6 is opened
Database checkpoint for Runtime record is started
Mapping the Database table fields with the values of those fields displaying in application
window by selecting Hand symbol
Hand tool is selected and pointed to Name text field value and double clicked on text field of
Name
Hand tool is selected and pointed to Order No and double clicked on text field of Order No
Hand tool is selected and pointed to Ticket and double clicked on text field of Tickets
Select one or more matching records option and click finish to complete creation of runtime
record checkpoint
The database field values are compared with the values that are displayed in the application
window during the test run using runtime record checkpoint
Matching values are displayed
Result:We have successfully created a database checkpoint for runtime record check that
verifies the values in the application and values stored in the database are matched or not.
Experiment 9 : Data driven test for dynamic test data submission
Aim: To Data driven test for dynamic test data submission
Theory:
Data Driven Testing is a software testing method in which test data is stored in table or spreadsheet
format. Data driven testing allows testers to input a single test script that can execute tests for all test data
from a table and expect the test output in the same table. It is also called table-driven testing or
parameterized testing.
Procedure :
Start->Programs->Wirunner->Sample application->Flist 1A
2. Open Flight Reservation Application
3. Go to Winrunner window
4. Create->Start recording
5. Select file->new order, insert the fields; Click the Insert Order
6. Tools->Data Table; Enter different Customer names in one row and Tickets in another row.
7. Default that two column names are Noname1 and Noname2.
8. Tools->Data Driver Winzard
9. Click Next button & select the data table
10. Select Parameterize the test; select Line by Line check box
11. Click Next Button
12. Parameterize each specific values with column names of tables;Repeat for all
13. Finally Click finish button.
14. Save the Test
Output:
Open WinRunner tool & Application
Recording in Context Sensitive Mode
Theory:
Batch test is used to run several tests and can see the results of all the tests in a single test result. A
batch test contains call statements, which open other tests.
During a test run, WinRunner interprets a call statement, and then opens and runs the called test. When
the called test is done, WinRunner returns to the batch test and continues the run
We can pass parameter values from the batch test to a called test.
Procedure:
for( i=0;i<3;i++)
{
call "c:\\qa\\flights\\lesson5"();
call "c:\\qa\\flights\\lesson6"();
call "c:\\qa\\flights\\lesson7"();
}
4. Choose the Batch Run option in the General Options dialog box.
Choose Tools > General Options.
In the General Options the Run category Run in batch mode click ok
5. Save the batch test.
Output:
Test Result
Steps:
Test case : To test the Inverse operation (inverse of 4 using 1/x button)
Select the Calculator application and start recording the actions. a Click "4" on the Calculator
Click the "1/x" button on the Calculator to find the inverse of 4.
The result, 0.25 will be displayed on the Calculator.
Test Result
Result : Test case for calculator in windows application are done successfully .