WinRunner Introduction

Introdution:
WinRunner, Mercury Interactive's enterprise functional testing tool. It is used to quickly create and run sophisticated automated tests on the application. WinRunner helps to automate the testing process from test development to execution. We can create adaptable and reuasble test scripts that challange the functionality of the application. Prior to a software release, we have to run these tests in a single overnight run - enabling to detect and ensure superior software quality.
What is new in WinRunner? 
Automatic Recovery:
The Recovery Manager provides an easy to use wizard that guides through the process of defining a recovery scenario. One can specify one or more operations that enable the test run to continue after an exception event occurs. This functionality is especially useful during unattened test runs, when errors or crashes could interrupt the testing process until manual intervension occurs.
Silent Installation:
Now we can install WinRunner in an unatteneded mode using previously recorded installation preferences. This feature is especially beneficial for those who use enterprise software management products or any automated software distribution mechanisms.
Enhanced Integration with Test Director:
WinRunner works with both Test Director 6.0, which is client/server-bases, and Test Director 7.x, which is Web-based. When reporting defects from WinRunner's test results window, basic information about the test and any checkpoints can be automatically populated in Test Director's defect form. WinRunner now supports version control, which enables updating and revising test scripts while maintaining old versions of each test.
Support for Terminal Servers:
Support for Citrix and Microsoft Terminal Servers makes it possible to open several window clients and run WinRunner on each client as a single user. Also, this can be used with LoadRunner to run multiple WinRunner Vusers.
Support for more Environments:
WinRunner 7.5 includes support for Internet Explorer 6.x and Netscape 6.x, Windows XP ans Sybase's PoerBuilder 8, in addition to 30+ environments already supported by WinRunner 7.
WinRunner provides the most powerful, productive and cost-effective solution for verifying enterprise application functionality.

WinRunner (Features and Benifits)
Test functionality using multiple data combinations in a single test:
WinRunner's Data Driver Wizard eliminates programming to automate testing for large volumes of data. This saves testers significant amounts of time preparing scripts and allows for more through testing.
Significantly increase power and flexibility of tests without any programming
The Function Generator presents a quick and error free way to design tests and enhance scripts without any programming knowledge. Testers can simply point at a GUI object, and winrunner will examine it, determine its class and suggest an appropriate function to be used.
Use multiple verification types to ensure sound functionality:
WinRunner provides checkpoints for text, GUI, bitmaps, URL links and the database, allowing testers to compare expected and actual outcomes and identify potential problems with numerous GUI objects and their functionality.
Verify data integrity in the back-end database:
Built in database verification confirms values stored in the databse and ensures transaction accuracy and the data integrity of records that have been updated, deleted and added.
View, store and verify at a glance every attribute of tested objects:
WinRunner's GUI Spy automatically identifies, records and displays the properties of standard GUI objects, ActiveX controls, as well as Java objects and methods. This ensures that every object in the user interface is recognized by the script and can be tested.
Maintain tests and build reusable scripts:
The GUI map provides a centralized object repository, allowing testers to verify and modify any tested object. These changes are then automatically propogated to all appropriate scripts, eliminating the need to build new scripts each time the application is modified.
Test multiple environments with a single application:
WinRunner supports more than thirty environments include Web, Java, Visual basic, etc. In addition, it provides targeted solutions for such leading ERP/CRM applications as SAP, Siebel, PeopleSoft and a number of others

Navigational Steps for WinRunner Lab-Excercises
Using Rapid Test Script wizard
- Start --> Program Files --> winrunner --> winrunner
- Select the Rapid Test Script Wizard (or) Create --> Rapid Test Script wizard
- Click Next button of welcome to script wizard
- Select hand icon and click on Application window and Click next button
- Select the tests and click Next button
- Select Navigation controls and click next button
- Set the Learning Flow (Express or Comprehensive) and click Learn button
- Select start application YES or NO, then click Next button
- Save the Startup script and GUI map files, click Next button
- Save the selected tests, click Next button
- Click Ok button
- Script will be generated then run the scripts. Run --> Run from top
- Find results of each script and select tools --> text report in winrunner test results.
Using GUI-Map Configuration Tool
- Open an application
- Select Tools --> GUI Map Configuration; Window pop-up
- Click ADD button; Click on hand icon
- Click on the object, which is to be configured. A user defined class for that object is added to list
- Select User defined class you added and press 'Configure' button
- Mapped to Class; (Select a corresponding standard class from the combo box)
- You can move the properties from available properties to Learned Properties. By selecting Insert button
- Select the Selector and recording methods.
- Click Ok button
- Now, you will observe winrunner identifying the configured objects.
Using Reord - Context Sensitive mode:
- Create --> Record context Sensitive
- Select start --> program files --> Accessories --> calculator
- Stop recording
- Run from Top; Press 'OK'
Using Record - Analog Mode:
- Create --> Insert Function --> From function generator
- Function name: (select 'invoke_application' from combo box)
- Click Args button; File: mspaint
- Click on 'paste' button; Click on 'Execute' button to open the application; Finally click on 'Close'
- Create --> Record - Analog
- Draw some picture in the paintbrush file
- Stop recording
- Run --> Run from Top; Press 'OK'
GUI CheckPoints - Single Property Check
- Create --> Insert function --> Function Generator --> (Function name: Invoke_application; File :Flight 1a)
- Click on 'paste' and click on 'execute' & close the window
- Create --> Record Context sensitive
- Do some operations & stop recording
- Create --> GUI checkpoint --> For single property
- Click on some button whose proprty to be checked
- Click on paste
- Now close the Flight 1a application; Run --> Run from top
- Press 'OK' it displays results window
- Double click on the result statement. it shows the expected value & actual value window.
GUI CheckPoints - For Object/Window Property
- Create --> Insert function --> Function Generator --> (Function name:Invoke_application; File :Flight 1a)
- Click on 'paste' and click on 'execute' & close the window
- Create --> Record Context sensitive
- Do some operations & stop recording
- Create --> GUI Check Point --> Object/Window Property
- Click on some button whose property to be checked
- Click on paste.
- Now close the Flight 1a application; Run --> Run from top
- Press 'OK' it displays results window
- Double click on the result statement. It shows the expected value and actual value window.
GUI CheckPoints - For Object/Window Property
- Create --> Insert function --> Function Generator --> (Function name:Invoke_application; File :Flight 1a)
- Click on 'paste' and click on 'execute' & close the window
- Create --> Record Context sensitive
- Do some operations & stop recording
- Create --> GUI Check Point --> For Multiple Object
- Click on some button whose property to be checked
- Click on Add button
- Click on few objects & Right click and quit
- Select each object and select corresponding properties to be checked for that object: Click 'OK'
- Create --> Record Context sensitive
-Run --> Run from Top. It displays Results
BITMAP CHECKPOINT
For object/window
- Create --> Insert function --> Function Generator --> (Function name:Invoke_application; File :Flight 1a)
- Click on 'paste' and click on 'execute' & close the window
- Create --> Record Context sensitive
- Enter Username, Password & click 'OK' button
- Open the order in Flight Reservation Application
- Select File --> Fax Order & enter fax Number, Signature
- Press 'Cancel' button
- Create --> Stop Recording
- Then open Fax Order in Flight Reservation Application
- Create --> Bitmap Check --> For obj.window;
- Run --> Run from Top
- The Test fails and you can see the difference
For Screen Area:
- Open new Paint Brush file;
- Create --> Bitmap checkpoint --> from screen area
- Paint file pops up; select an image with cross hair pointer
- Do slight modification in the paint file (you can also run the same paint file);
- Run --> Run from top
- The test fails and you can see the difference of images.
Database Checkpoints
Using default check (for MS-Access only)
- Create --> Database Checkpoint --> Default check
- Select the specify SQL Statement check box
- Click next button
- Click Create button
- Type New DSN name and click new button
- Then select a driver for which you want to set up a database & double click that driver
- Then select browse button and retype same DSN name and Click save button.
- Click Next button & click finish button
- Select database button & set path of the database name
- Click 'OK' button & then click the DSN window 'OK' button
- Type SQL query in SQL box
- Then click Finish button
Note: Same process will be for Custom check point
Runtime Record CheckPoint
Repeat above ten steps
- Type query of two related tables in SQL box Ex: select Orders. Order_Number, Flights.Flight_Number from Orders, Flights where Flight.Flight_Number = Orders.Flight_Number
- Select Finish Button
- Select hand icon button & select Order No in the application
- Click Next button
- Select hand icon button & select Flight No in the application
- Click Next button
- Select any one of the following check box
1. One match record
2. One or more match records
3. No match record
- Select Finish button, the script will be generated
Synchronization Point
For Obj/Win Properties
- Open start --> programs --> winrunner --> Sample applications --> Flight 1A
- Open winrunner window
- Create --> Record Context Sensitive
- Insert information for new Order & click on 'insert Order" button
- After inserting click on "delete" button
- Stop recording & save the file
- Run --> Run from top: Gives you results.
Without Synchronization
- Settings --> General Options --> Click on "Run" tab. "Timeout for checkpoints and C's statements value: 10000 follow 1 to 7 --> the test display on "Error Message" that "delete" button is disabled
With Synchronization
- Keep timeout value: 1000 only
- Go to the Test Script file, insert pointed after "Insert Order" button, press statement
- Create --> Synchronization --> For Obj/Window property
- Click on "Delete Order" button and select enable property; click on "paste"
- It inserts the Sync statement
For Obj/Win bitmap
- Create --> Record Context Sensitive
- Insert information for new order and click on "Insert order" button
- Stop recording and save the file
- Go to the TSL Script, just before inserting of data into "date of flight" insert pointer
- Create --> Synchronization --> For Obj/Win bitmap is selected
- (Make sure flight reservation is empty) click on "data of flight" text box
- Run --> Run from top; results are displayed. Note: (Keep "Timeout value" :1000)
Get Text: From Screen Area
(Note: Checking whether Order no is increasing when ever Order is created)
- Open Flight 1A; Analysis --> graphs (Keep it open)
- Create --> get text --> from screen area
- Capture the No of tickets sold; right click and close the graph
- Now, insert new order, open the graph (Analysis --> graphs)
- Go to Winrunner window, create --> get text --> from screen area
- Capture the No of tickets sold and right click; close the graph
- Save the script file
- Add the following script; If (text2==text1) t1_step("text comparison",0,"updated"); else t1_step("text comparison", 1, "update property");
- Run --> Run from top to see the results.
Get Text: For Object/Window
- Open a "Calc" application in two windows (Assuming two are different versions)
- Create --> get text --> for Obj/Window
- Click on some button in one window
- Stop recording
- Repeat 1 to 4 for capture the text of same object from another "Calc" application
- Add the following TSL (Note: Change 'text" to text1 & text2 for each statement) if (text1 == text2) report_msg("correct" text1); else report_msg("incorrect" text2);
- Run and see the results
Merge the GUI Files
Manual Merge
- Tools --> Merge GUI map files. A winrunner message box informs that all open GUI maps will be closed and all unsaved changes will be discarded and click 'OK' button
- Select the Manual Merge. Manual Merge enables to add manually add GUI objects from the source to target files
- To specify the target GUI map file click the browse button and select GUI map file
- To specify the Source GUI map file. Click the add button and select source GUI map file
- Click 'OK' button
- GUI Map File Manual Merge Tool Opens Select Objects and move Source File to Target file
- Close the GUI Map file Manual Merge tool
Auto Merge
- Tool --> Merge GUI map files. A winrunner message box informs that all open GUI maps will be closed and all unsaved changes will be discarded and click 'OK' button
- Select the Auto Merge in Merge type. If you chose Auto Merge and the source GUI files are merged successfully without conflicts
- To specify the target GUI map file click the browse button and select GUI map file
- To specify the Source GUI map file
- Click the add button and select source GUI map file
- Click 'OK' button A message confirms the merge.
Manually Retrive the records from Database
db_connect(query1, DSN=Flight32);
db_execute_query(query1, select * from Orders,rec);
db_field_value(query1, #0,#0);
db_get_headers(query1, field_num,headers);
db_get_row(query1,5,row_con);
db_write_records(query1,,c:\\str.txt,TRUE,10);

No comments:

Post a Comment