【正文】
ete list of flights booked by the current agent. Which objects on the itinerary page would you count in order to determine the number of current itineraries? Which property or properties would you use to identify those objects? (Hint: Open the Mercury Tours application and use Object Spy to examine how the objects are defined.) Part 1: Analyze the requirements How would you retrieve a count of those objects on the itinerary page? How would you save the count of the original number of itineraries in order to pare it to a later count? How would you indicate success in the test results if the number of itineraries incremented correctly and indicate failure if the number did not increment successfully? Part 1: Analyze the requirements 2. The page displays a list of booked itineraries in the order that they were purchased, with the earliest itinerary listed first. There is a WebTable cell with text “Booked YYYYMMDD HH:MM:SS” for each itinerary. The name property for the WebTable always matches the name of the Checkbox object for that same itinerary. The following code has not been mented. Write what each block of code performs. Set objCheckboxDesc = () objCheckboxDesc (“type) . Value = “checkbox” Set objCheckboxes = Browser(“Wele:Mercury Tours”) .Page(“Itenerary: Mercury Tours”) .ChildObjects(objCheckboxDesc) Part 1: Analyze the requirements str Name = objCheckboxes(0).GetROProperty(“name”) Set objTableDesc = () objTableDesc(“html tag”).Value = “table” objTableDesc(“rows”).Value = 1 objTableDesc(“name”).Value = strName Set objBookedTables = Browser(“Wele: Mercury Tours”) .Page(“Itenerary: Mercury Tours”) .ChildObjects(objTableDesc) If 1 Then micWarning, “”, amp。” were found when one object should have been found.” Else strBookedFirstItinerary = objBookedTables (0).GetROProperty (“text”) micDone, “strBookedFirstItinerary”, strBookedFirstItinerary End If Part 1: Analyze the requirements How would you retrieve year information from the text string “ Booked YYYYMMDD HH:MM:SS”? How would you retrieve month information from the text string “ Booked YYYYMMDD HH:MM:SS”? How would you convert the month value from a number to the name for that month? Part 2: Update the script for the first objective. Copy the script PETFRIENDLY and add the steps needed to check that the itinerary count is increasing as expected. 1. Within the Mercury Tours application, cancel all itineraries except one. Note: You can do this by clicking CANCEL ALL RESERVATIONS and then adding a new purchase, or by selecting all the itineraries except one and clicking CANCEL CHECKED RESERVATIONS. 2. Open the test PETFRIENDLY located in the C:\TRAINING\QTP82ADVANCED\TESTS folder. 3. Copy the test by using FILE?SAVE AS to create a new test named CHECKITINERARY. 4. Update the test with code necessary to achieve this objective. 5. Run and debug the updated test. If your test did not plete successfully, use the QTP debug features to help pinpoint the script?s trouble areas. Check with your instructor if problems persist. Part 3: Update the script for the second objective. 1. Update the test with code necessary to output the year and month when the first itinerary was booked. 2. Run and debug the updated test. 3. Confirm that your script works even when the AUT starts out with no itineraries. If your test did not plete successfully, use the QTP debug features to help pinpoint the script?s trouble areas. Check with your instructor if problems persist