software testing tools lab record

40
Spying on GUI Objects AIM: To check the properties of the GUI objects using GUI spy in winrunner Procedure: 1. Open any Visual basic application 2. Start WinRunner Programs > WinRunner > WinRunner 3. Open, choose File > New. 4. Open GUI Spy Choose Tools > GUI Spy 5. GUI Spy window open 6. Position the GUI Spy on the desktop so that both the application window and the GUI Spy are clearly visible 7. In the GUI Spy, click the Spy button. Move the pointer over objects in the visual basic application window. 8. Each object will flashes as we move the pointer over it, and the GUI Spy displays its properties. 9. Place the pointer over the OK button and press 10. Left Ctrl + F3. This freezes the OK button’s description in the GUI Spy 11. Examine the properties of the OK button 12. Like wise check the properties of all the objects in the visual basic application

Upload: kaviarasud

Post on 27-Apr-2015

688 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Software Testing Tools Lab Record

Spying on GUI Objects

AIM:To check the properties of the GUI objects using GUI spy in winrunner

Procedure:1. Open any Visual basic application

2. Start WinRunner Programs > WinRunner > WinRunner

3. Open, choose File > New.

4. Open GUI Spy Choose Tools > GUI Spy

5. GUI Spy window open

6. Position the GUI Spy on the desktop so that both the application window and the GUI Spy are clearly visible

7. In the GUI Spy, click the Spy button. Move the pointer over objects in the visual basic application window.

8. Each object will flashes as we move the pointer over it, and the GUI Spy displays its properties.

9. Place the pointer over the OK button and press

10. Left Ctrl + F3. This freezes the OK button’s description in the GUI Spy

11. Examine the properties of the OK button

12. Like wise check the properties of all the objects in the visual basic application

13. Save the test choose File>save

Page 2: Software Testing Tools Lab Record
Page 3: Software Testing Tools Lab Record

Result:The give test condition is implemented and the output is verified successfully

Page 4: Software Testing Tools Lab Record

RapidTest Script Wizard

Aim:

To create rapid test script using rapid test script wizard

Procedure:1. Open any Windows application2. Start WinRunner choose Programs > WinRunner >WinRunner on the Start

menu3. Open a new test choose File > New4. Start the RapidTest Script wizard Choose Insert > RapidTest Script Wizard5. Click Next in the wizard’s Welcome6. Click the hand button and then click anywhere in the Windows application7. The application’s window name appears in the wizard’s Window.Click Next8. Clear all the check boxes in the wizard Click Next9. Accept the default navigation controls (... and > >) And Click Next10. Set the learning flow to “Express.” Click the Learn button11. The Rapidscript Generator checks the application and starts to generate script12. Save the script and GUI map file Click Next 13. RapidTest Script wizard will be closed now14. Now open GUI Map editor Choose Tools>Gui Map Editor15. Gui Map Editor Displayes all the object and the properties of the objects in

windows application which is checked.16. Close GUI Map Editor17. Save the test choose file>save

Page 5: Software Testing Tools Lab Record
Page 6: Software Testing Tools Lab Record
Page 7: Software Testing Tools Lab Record
Page 8: Software Testing Tools Lab Record

Result:

The give test condition is implemented and the output is verified successfully

Page 9: Software Testing Tools Lab Record

Recording the Test

Aim:To record the operations which are performed on an application and to run the test again using winrunner

Procedure:

1. Start winrunner Choose Programs > WinRunner > WinRunner from start menu

2. Open a new test Choose File > New

3. Open any windows application

4. Start recording in Context Sensitive mode choose Test> Record-Context Sensitive or press F2

5. Winrunner starts to record the operations being performed

6. Go to the windows application and start to perform the operations

7. Stop the recording choose Test > Stop Recording or press Ctrl_L+F3 to stop- the recording

8. Save the test choose File>Save to save the test

9. Run the test choose Test> Run from top or press Ctrl_L+F5 to start the test

10. Give name for the test result Dialogue box

11. The Test result is shown in the Test Results window

12. Exit Winrunner

Page 10: Software Testing Tools Lab Record

Generated Test Script:

# Form1set_window ("Form1", 6);edit_set ("Text1", "arun");obj_type ("Text1","<kTab>");button_press ("Login");

# Project2_0set_window ("Project2_0", 0);button_press ("OK");

# Form1set_window ("Form1", 8);edit_set ("Text1", "praba");button_press ("Login");

# Project2_0set_window ("Project2_0", 0);button_press ("OK");

# Form1set_window ("Form1", 5);edit_set ("Text1", "dina");button_press ("Login");

# Project2_0set_window ("Project2_0", 1);button_press ("OK");

# Form1set_window ("Form1", 2);edit_set ("Text1", "ram");button_press ("Login");

# Project2_0set_window ("Project2_0", 1);button_press ("OK");

# Form1set_window ("Form1", 3);edit_set ("Text1", "raju");button_press ("Login");

# Project2_0set_window ("Project2_0", 1);button_press ("OK");

Page 11: Software Testing Tools Lab Record
Page 12: Software Testing Tools Lab Record

Result:The give test condition is implemented and the output is verified successfully

Page 13: Software Testing Tools Lab Record

Checking Text

Aim:To check the text in an application using winrunner

Procedure:1. Start Winrunner choose Programs > WinRunner > WinRunner From the

start menu

2. Run the Sample application

3. Start recording in Context Sensitive mode choose Test> Record-Context Sensitive or press F2

4. Winrunner starts to record the operations being performed

5. Input the values and do the operations

6. Stop the recording choose Test > Stop Recording or press Ctrl_L+F3 to stop- the recording

7. insert function for objects from the application choose Insert>Functions>For Objects/Windows or press F8

8. Choose the particular object from the application by clicking on it

9. Function generator window pops up click on paste

10. the function will be placed in test script

11. Create the function for the required object using Function generator

12. write the script to validate the objects

13. Run the test choose Test> Run from top or press Ctrl_L+F5 to start the test

14. the test will be performed and result is displayed in the test results window

15. Exit Winrunner

Page 14: Software Testing Tools Lab Record

Test Script:

set_window ("Form1", 4);edit_set ("Text1", "12");edit_set ("Text2", "45");button_press ("Login");

Validation part:

edit_get_text("Text1",t1);edit_get_text("Text2",t2);edit_get_text("Text3",res);if(t1+t2 == res)tl_step("Test",0,"True");elsetl_step("test",1,"false");

Page 15: Software Testing Tools Lab Record
Page 16: Software Testing Tools Lab Record
Page 17: Software Testing Tools Lab Record

Result:

The give test condition is implemented and the output is verified successfully.

Page 18: Software Testing Tools Lab Record

Checking Bitmaps

Aim:To check the bitmap images in a project and to verify that both the image are same

Procedure:1. Start winrunner. Choose Programs > WinRunner > WinRunner from start

menu

2. Open a new test. Choose File > New

3. Start recording in Context Sensitive mode. Choose Test> Record-Context Sensitive or press F2

4. Winrunner starts to record the operations being performed

5. Press F2 to pause the recording

6. insert the bitmap check point. Choose Insert > Bitmap Check point >For Object/Windows or press Ctrl_L+F2

7. Now click on the first bitmap object

8. Again Press F2 to pause the recording

9. insert the bitmap check point. Choose Insert > Bitmap Check point >For Object/Windows or press Ctrl_L+F2

10. Now click on the second bitmap object

11. Now we can view the bitmaps in the testresults window. Choose Tools>Test Results or press ALT_R+F8.

12. Double click on the bitmap image to view the image

13. Run the test choose Test> Run from top or press Ctrl_L+F5 to start the test

14. the test will be performed and result is displayed in the test results window

Page 19: Software Testing Tools Lab Record

15. To know the Difference between two bitmap images double click on the first bitmap image

16. the difference will be show between the bit map images

17. Exit Winrunner

Page 20: Software Testing Tools Lab Record

Test Script:# Analog Recording

move_locator_track (35);mtype ("<T156><kLeft>-<T125><kLeft>+");move_locator_track (36);mtype ("<T125><kLeft>-<T47><kLeft>+");set_window("Form1", 0);obj_check_bitmap("Picture1", "Img14", 1);move_locator_track (37);move_locator_track (38);mtype ("<T141><kLeft>-<T94><kLeft>+");move_locator_track (39);obj_check_bitmap("Picture1", "Img15", 9);

Page 21: Software Testing Tools Lab Record
Page 22: Software Testing Tools Lab Record
Page 23: Software Testing Tools Lab Record

Result:

The give test condition is implemented and the output is verified successfully

Page 24: Software Testing Tools Lab Record

Batch Mode Testing

Aim:To test multiple application multiple times with the help of batch mode testing

Procedure:1. Open the first application2. Start winrunner. Choose Programs > WinRunner > WinRunner from

start menu3. Open a new test. Choose File > New

4. Start recording in Context Sensitive mode. Choose Test> Record-Context Sensitive or press F2

5. Winrunner starts to record the test conditions6. Save the test choose File>Save to save the test7. Note the location where the test is saved8. Open the second application9. Open a new test. Choose File > New10. Start recording in Context Sensitive mode. Choose Test> Record-Context

Sensitive or press F211. save the test choose File>Save to save the test12. Note the location where the test is saved13. Open a new test. Choose File > New14. Write the script for performing batch test 15. Run the test choose Test> Run from top or press Ctrl_L+F5 to start the

test16. Now the results for all the test will be displayed in test results window17. Exit winrunner

Page 25: Software Testing Tools Lab Record

Test Script:

for(i=0;i<3;i++){call"F:\\software testing\\test1"();call"F:\\software testing\\test2"();}

Page 26: Software Testing Tools Lab Record
Page 27: Software Testing Tools Lab Record
Page 28: Software Testing Tools Lab Record

Result:The give test condition is implemented and the output is verified successfully

Page 29: Software Testing Tools Lab Record

Synchronizing Tests

Aim:To test synchronize tests for the application

Procedure:

1. Start WinRunner and open a new testchoose Programs > WinRunner >WinRunner on the Start menu

2. Start the Flight Reservation application and log in.Choose Programs > WinRunner > Sample Applications > Flight 1A on the Start menu

3. Start recording in Context Sensitive mode.Choose Create > Record—Context Sensitive or click the Record button on thetoolbar

4. Create a new order.Choose File > New Order in the Flight Reservation application

5. Insert the order into the database.Click the Insert Order button

6. Delete the order.Click the Delete Order button and click Yes in the message window to confirmthe deletion.

7. Stop recording.Choose Create > Stop Recording or click the Stop button

8. Save the test. Choose File > Save

9. Open the General Options dialog box.Choose Settings > General Options

10. Change the value to 1000 milliseconds (1 second).In the Timeout for Checkpoints and CS statements box, change the value to“1000”

11. Make sure that the lesson4 test window is active in WinRunner

12. Run the test Choose Run > Run from Top

13. Create > Synchronization Point > For Object/Window Bitmap or click the Synchronization Point for Object/Window Bitmap

14. Exit Winrunner

Page 30: Software Testing Tools Lab Record

Test script with error:

# Flight Reservationset_window ("Flight Reservation", 2);menu_select_item ("File;New Order");list_select_item ("cbxDepartures", "Los Angeles"); # Item

Number 1;list_select_item ("cbxDestinations", "San Francisco"); # Item

Number 2;button_press ("Flights...");

# Flights Tableset_window ("Flights Table", 1);button_press ("OK");

# Flight Reservationset_window ("Flight Reservation", 1);button_set ("First", ON);edit_set ("txtCustomerName", "arun");button_press ("Insert Order");set_window ("Flight Reservation", 3);button_press ("Delete Order");

# Flight Reservation Messageset_window ("Flight Reservation Message", 1);button_press ("Yes");

Test script with error rectified:

# Flight Reservationset_window ("Flight Reservation", 2);menu_select_item ("File;New Order");list_select_item ("cbxDepartures", "Los Angeles"); # Item

Number 1;list_select_item ("cbxDestinations", "San Francisco"); # Item

Number 2;button_press ("Flights...");

# Flights Tableset_window ("Flights Table", 1);button_press ("OK");

# Flight Reservationset_window ("Flight Reservation", 1);button_set ("First", ON);edit_set ("txtCustomerName", "arun");button_press ("Insert Order");obj_wait_bitmap("Insert Done...", "Img2", 1);set_window ("Flight Reservation", 3);button_press ("Delete Order");

# Flight Reservation Messageset_window ("Flight Reservation Message", 1);button_press ("Yes");

Page 31: Software Testing Tools Lab Record
Page 32: Software Testing Tools Lab Record

Result:

The give test condition is implemented and the output is verified successfully

Page 33: Software Testing Tools Lab Record