req0005-8

Download Req0005-8

If you can't read please download the document

Upload: renate

Post on 10-Jan-2016

19 views

Category:

Documents


1 download

DESCRIPTION

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. - PowerPoint PPT Presentation

TRANSCRIPT

  • Req0005-8Implementation of Req0005, Req0006, Req0007 and Req0008

    Dani Vainstein & Monika Arora Gautam

  • TIPFr 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 :12Click

    Dani Vainstein & Monika Arora Gautam

  • Topics coveredThe efficiency of the GUI layer.Action Return Values.Test Result Deletion Tool.

    Dani Vainstein & Monika Arora Gautam

  • Req0005The 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

  • Req0005 Scenario DetailsStep 1 Type agent name, more than 3 characters long.Step 2 Type a password less than 4 characters long.Step 3 Press OKStep 4A) Popup dialog is displayed.B) Popup title : Flight Reservations C) Message type : Exclamation D) Message text Password must be at least 4 characters longStep 5 Close the dialog.

    Dani Vainstein & Monika Arora Gautam

  • Req0005 Overview Detailstext = Password must be at least 4 characters long.Title = Flight ReservationsIcon = Exclamation

    Dani Vainstein & Monika Arora Gautam

  • Requirement - Req0005What 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

  • Implementing Business Req0005Open the test busLogin, action busLoginMngMenu : File Open Test

    Dani Vainstein & Monika Arora Gautam

  • Creating a new stepAdd a new step case req0005 ( remember to write the string in lower case )Req0005

    Dani Vainstein & Monika Arora Gautam

  • Implementing Business Req0005Do not forget to update FR.xls with following data :MSG0003 | Password must be at least 4 characters long | Flight Reservations | 1Case "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

    Dani Vainstein & Monika Arora Gautam

  • Implementing Test Req0005Create a new Test Req0005Make the same steps as we did for Req0004

    Dani Vainstein & Monika Arora Gautam

  • Modifying the TestChange the header.'***********************************************************************'@Author : advancedQTP'@Date Created : '@QTP Version : 9.2'@Description : The test covers the requirement Req0005'@Input Parameter : None.'@Out Parameter : None.'@Ass. Libraries : FR.vbs'@Addins : ActiveX'@Modifications : (Later modification on top)'
  • Modifying the Test Settings and call to Business actionSelect Menu SettingsAdd DescriptionRunAction "busLoginMng [busLogin]", oneIteration, "Req0005"

    Dani Vainstein & Monika Arora Gautam

  • Req0006 and Req0007

    Dani Vainstein & Monika Arora Gautam

  • Implementing Business Req0006 and Req0007Case "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

  • Updating Data SourceAnd dont forget to add the new messages to the data source.

    Dani Vainstein & Monika Arora Gautam

  • Req0008When 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

  • Implementing Business Req0008bExist 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.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." End If

    Dani Vainstein & Monika Arora Gautam

  • Variables DeclarationIn order to avoid from receiving runtime errors, always declare the new variables.Declaring VariablesUsing Dim keyword

    Dani Vainstein & Monika Arora Gautam

  • Modifying guiLoginCase "loginexists" bExist = Dialog( "Login" ).Exist( 1 ) ExitAction( bExist )

    Dani Vainstein & Monika Arora Gautam

  • Create Tests Req0006 to Req0008Please follow the steps described earlier, and create Test Req0006, Req0007 and Req0008

    Dani Vainstein & Monika Arora Gautam

  • Adding Tests to the MTMExcel file must be closed every time you run a script or/and a .mtm or .mtb batch file.

    Dani Vainstein & Monika Arora Gautam

  • Results

    Dani Vainstein & Monika Arora Gautam

  • Deleting old ResultsAfter 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 dont want to keep run history.Results Folders

    Dani Vainstein & Monika Arora Gautam

  • Test Results Deletion ToolEvery 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

  • Test Results Deletion Tool

    Dani Vainstein & Monika Arora Gautam

  • Test Results Deletion Tool

    Dani Vainstein & Monika Arora Gautam

  • Test Results Deletion Tool

    Dani Vainstein & Monika Arora Gautam

  • Test Results Deletion ToolInclude test results found in subfolders

    Dani Vainstein & Monika Arora Gautam

  • Test Results Deletion ToolIf you run your tests using MTM, dont forget to remove old reports under REP folder.

    Dani Vainstein & Monika Arora Gautam

  • SummaryWe learned how to use the Global Dictionary as a controller for the GUI layerWe 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

  • Whats Next?Implementing Req0009Adding 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

  • *Make sure to visit us for:TutorialsArticlesProjectsAnd much [email protected]

    Dani Vainstein & Monika Arora Gautam

    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"

    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." End If

    Case "loginexists" bExist = Dialog( "Login" ).Exist( 1 ) ExitAction( bExist )