1 / 33

Req0005-8

Req0005-8. Implementation of Req0005, Req0006, Req0007 and Req0008. TIP. Fr Project staff have made an improvement to the presentations. Whenever you see QTP code, right click the left bottom part of the presentation and do the following :. 1. 2. Click. Topics covered.

renate
Download Presentation

Req0005-8

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Req0005-8 Implementation of Req0005, Req0006, Req0007 and Req0008 Dani Vainstein & Monika Arora Gautam

  2. TIP • Fr Project staff have made an improvement to the presentations. • Whenever you see QTP code, right click the left bottom part of the presentation and do the following : 1 2 Click Dani Vainstein & Monika Arora Gautam

  3. Topics covered • The efficiency of the GUI layer. • Action Return Values. • Test Result Deletion Tool. Dani Vainstein & Monika Arora Gautam

  4. Req0005 • The password must be at least 4 characters long. • Less than 4 characters will trigger an exclamation popup message “Password must be at least 4 characters long.” Dani Vainstein & Monika Arora Gautam

  5. Req0005 – Scenario Details • Step 1 – Type agent name, more than 3 characters long. • Step 2 – Type a password less than 4 characters long. • Step 3 – Press OK • Step 4 • A) Popup dialog is displayed. • B) Popup title : Flight Reservations • C) Message type : Exclamation • D) Message text “Password must be at least 4 characters long’ • Step 5 – Close the dialog. Dani Vainstein & Monika Arora Gautam

  6. displayed=true Ispopup = true Req0005 – Overview Details Title = Flight Reservations Icon = Exclamation text = Password must be at least 4 characters long. Dani Vainstein & Monika Arora Gautam

  7. Requirement - Req0005 • What are the differences between Req0004 and Req0005? • Nothing. The test process is the same, the only difference is that we are testing different field and different message. Dani Vainstein & Monika Arora Gautam

  8. Implementing Business Req0005 • Open the test busLogin, action busLoginMng • Menu : File  Open  Test Dani Vainstein & Monika Arora Gautam

  9. Creating a new step • Add a new step case “req0005” ( remember to write the string in lower case ) Req0005 Dani Vainstein & Monika Arora Gautam

  10. Implementing Business Req0005 Case"req0005" GDictionary.Add"AGENT_NAME", "advancedQTP" GDictionary.Add"PASSWORD", vbNullString : GDictionary.Add"OK", vbNullString For i = 1 To 3 GDictionary( "PASSWORD" ) = String( i, "a" ) Reporter.ReportEvent micInfo, "Req0005", "String length is " & i RunAction "guiLogin [guiLogin]", oneIteration, "Login" ' ** Req0005 - 'Password must be at least 4 characters long.' RunAction "CheckDialog [guiLogin]", oneIteration, "MSG0003" Next • Do not forget to update FR.xls with following data : • MSG0003 | Password must be at least 4 characters long | Flight Reservations | 1 Dani Vainstein & Monika Arora Gautam

  11. Automation FR LIB RA BL GL RS DOC DAT SETTING Req0005 TESTS RES BATCH ENV Implementing Test Req0005 • Create a new Test “Req0005” • Make the same steps as we did for Req0004 Dani Vainstein & Monika Arora Gautam

  12. Modifying the Test • Change the header. '*********************************************************************** '@Author : advancedQTP '@Date Created : <ddd MMM dd, yyyy> '@QTP Version : 9.2 '@Description : The test covers the requirement Req0005 '@Input Parameter : None. '@Out Parameter : None. '@Ass. Libraries : FR.vbs '@Addins : ActiveX '@Modifications : <#n By <Name>, Date: <dd-mmm-yyyy>> (Later modification on top) ' <#n-1 By <Name>, Date: <dd-mmm-yyyy> '*********************************************************************** Dani Vainstein & Monika Arora Gautam

  13. Modifying the Test Settings and call to Business action • Select Menu  Settings Add Description RunAction "busLoginMng [busLogin]", oneIteration, "Req0005" Dani Vainstein & Monika Arora Gautam

  14. Req0006 and Req0007 Dani Vainstein & Monika Arora Gautam

  15. Implementing Business Req0006 and Req0007 Case"req0006" GDictionary.Add"AGENT_NAME", "advancedQTP" GDictionary.Add"OK", vbNullString RunAction "guiLogin [guiLogin]", oneIteration, "Login" ' ** Req0006 - 'Please enter password' RunAction "CheckDialog [guiLogin]", oneIteration, "MSG0004" Case"req0007" GDictionary.Add"AGENT_NAME", "advancedQTP" : GDictionary.Add"PASSWORD", "1234" GDictionary.Add"OK", vbNullString RunAction "guiLogin [guiLogin]", oneIteration, "Login" ' ** Req0007 - 'Incorrect password. Please try again' RunAction "CheckDialog [guiLogin]", oneIteration, "MSG0005" Dani Vainstein & Monika Arora Gautam

  16. Updating Data Source • And … don’t forget to add the new messages to the data source. Dani Vainstein & Monika Arora Gautam

  17. Req0008 • When we press on Cancel button, the application should be closed. • We will use the same “login” process used with previous tests ( req0006,7 ) • In addition to this, we will add a new CASE in guiLogin, that verify whether “Login” dialog exists or not. • Lastly, we will use the action return value. Dani Vainstein & Monika Arora Gautam

  18. Implementing Business Req0008 Case"req0008" GDictionary.Add"CANCEL", vbNullString RunAction "guiLogin [guiLogin]", oneIteration, "Login" ' ** Req0008 - 'Application canceled' bExist = RunAction( "guiLogin [guiLogin]", oneIteration, "LoginExists" ) If Not bExist Then Reporter.ReportEvent micPass, "Req0008", "Dialog not exists." Else Reporter.ReportEvent micFail, "Req0008", "Dialog exists." EndIf • bExist holds the return value of the guiLogin reusable-action. • Whenever a reusable-action is called using a return value, the call must be enclosed within parenthesis. Dani Vainstein & Monika Arora Gautam

  19. Variables Declaration • In order to avoid from receiving runtime errors, always declare the new variables. Declaring Variables Using Dim keyword Dani Vainstein & Monika Arora Gautam

  20. Modifying guiLogin Case"loginexists" bExist = Dialog( "Login" ).Exist( 1 ) ExitAction( bExist ) Dani Vainstein & Monika Arora Gautam

  21. Create Tests Req0006 to Req0008 • Please follow the steps described earlier, and create Test Req0006, Req0007 and Req0008 Dani Vainstein & Monika Arora Gautam

  22. Adding Tests to the MTM • Excel file must be closed every time you run a script or/and a .mtm or .mtb batch file. Dani Vainstein & Monika Arora Gautam

  23. Results Dani Vainstein & Monika Arora Gautam

  24. Deleting old Results • After a while, when you run tests or test batch several times, results folders will start to accumulate. • Results Folders volume can be very big, now that is a serious problem, but sometimes you don’t want to keep run history. Results Folders Dani Vainstein & Monika Arora Gautam

  25. Test Results Deletion Tool • Every test saves history of run. • Manually you can go to each folder and remove the Resx Folder, or you can write a script. • This can be a frustrating job. • Let me introduce you to the “Test Results Deletion Tool” Dani Vainstein & Monika Arora Gautam

  26. Test Results Deletion Tool Dani Vainstein & Monika Arora Gautam

  27. Test Results Deletion Tool Dani Vainstein & Monika Arora Gautam

  28. Test Results Deletion Tool Dani Vainstein & Monika Arora Gautam

  29. Full information on tests That were found and disk Available space You can sort tests by Date, size, name and time Select all items, Or those that You want to remove Test Results Deletion Tool Include test results found in subfolders Dani Vainstein & Monika Arora Gautam

  30. Test Results Deletion Tool • If you run your tests using MTM, don’t forget to remove old reports under REP folder. Dani Vainstein & Monika Arora Gautam

  31. Summary • We learned how to use the Global Dictionary as a controller for the GUI layer • We learned how to use already implemented functionality for new tests. • We learned how to use the Test Results Deletion Tool. Dani Vainstein & Monika Arora Gautam

  32. What’s Next? • Implementing Req0009 • Adding an environment variable manually. • Creating a regular “successful login” process. • Usage of global dictionary. • Adding tests to MTM. • Using the action return value. Dani Vainstein & Monika Arora Gautam

  33. Make sure to visit us for: Tutorials Articles Projects And much more @ www.AdvancedQTP.com 33 Dani Vainstein & Monika Arora Gautam

More Related