session objectives how to debug ptf test case/script session-6 debuggingslide 2
TRANSCRIPT
Session Objectives
• How to Debug PTF test case/Script
Session-6 Debugging Slide 2
Debugging A Test Case
• Debugging a test in PTF makes it structured and user –friendly and allows us to make modifications for betterunderstanding.
• Debugging can be done once a test is saved and a log isavailable.
• There are 2 ways to debug a test:
• Debugging Test Editor
• Debugging Log
Session-6 Debugging Slide 3
Debugging in Test Editor
• Step Into - Executes the current step and advances to the next
step.
• Step Over - Executes the current step of the test and
advances to the next step, unless the next step calls anothertest.
• Toggle Break - Sets a break point at the selected step or
removes an existing breakpoint.
• Clear All Breaks - Removes all break points.
Session-6 Debugging Slide 4
Toggle Breaks
• Toggle breaks set a breakpoint at the selected step to pause a
test or remove an existing breakpoint.
• Toggle break icon is available on the Test Editor
• It helps us to stop a test midway and make any changes if
required on the online page.
• To add a toggle break, take the cursor to the sequence next to
where you want to pause and click on the icon.
• To remove a toggle, select the sequence and click on the icon.
Session-6 Debugging Slide 5
Debugging - Toggle
Toggle Break
Test will pause aftersequence 105 is executed.
Session-6 Debugging Slide 6
Stop on Error
• Execution is terminated on error if the ‘stop on error’menu is clicked before executing the test.
• This option helps the user find the exact test which failedthe Shell Test.
• It also prevents the execution of the remaining test andsaves time in the case of large tests.
Stop on error
Session-6 Debugging Slide 7
Streamline/Improve Performance
A script can be debugged in test editor by using thefollowing
• Modify test data in value column
• Log messages
• Page Prompt
• Error Handling
Session-6 Debugging Slide 8
Streamline/Improve Performance
• Log Message is intended to increase understanding of the test.
• A log message allows us to insert any message between the teststeps without affecting the running of the test.
Session-6 Debugging Slide 9
Page Prompt
• A Page prompt is used to skip navigation steps and reachthe desired online page directly.
• Replaces explicit navigation in the test and takes the userdirectly to the component search page by URL manipulation
• PTF page prompting steps make tests more robust andrepeatable by simplifying test data
• Opens a component based on theMENU.COMPONENT.MARKET recognition string
• If the component has a search page, use thePage.PromptOk action to close the search page.
Session-6 Debugging Slide 10
Steps to Add a Page Prompt
Go to the required online page
Make a note of the Menu.Component.Marketstring from the URL address
Alternatively, press Ctrl + J to find out the string
Open the test editor
Inactivate/delete all the navigation steps
Insert a new row above the navigation steps
Add Page/Prompt – To add a Page Prompt
Enter the above string in recognition column
Enter ADD/UPDATE in the value column forAdd/Modify actions
Session-6 Debugging Slide 11
How to Pick a String from an Online Page
The string can be picked up directlyfrom the URL. This representsComponent.Menu.Market.
Press Ctrl+J on the onlinepage. This page opens up.
The component and menunames are available here.The Market name is normallyGBL
Session-6 Debugging Slide 12
Screen ShotLog message to explain thesteps below is inserted.
Menu.Component.Marketstring for job data page
UPDATE action for editingjob data
Navigation steps inactivated
Session-6 Debugging Slide 13
PTF Error Handling
To handle errors and warning messages that pop up during the test,PTF uses message recognition.
Boeing Recommendation – Capture Warning message only.
Use Message Recognition
The link becomesactivated when ErrorHandling is checked
The number of the warningmessage, along with desiredaction is entered here
Session-6 Debugging Slide 14
Debugging Log
Log can be debugged using the followings
• Flags in log file
• Screenshots of the error
• Highlight errors
Session-6 Debugging Slide 15
Flags in Log File
• Each step of the log has a flag attached to it.
• The red flag in the logs shows that the step in the test isfailed. When it is expanded, the logs also give the reasonfor the failure. Using the information, the failed step mustbe fixed
• The following flags are available in log:
Information message onlyor
Information message onlyor
Step was successfulor
Step was successful, butorwith a warning
Step failedor
The test encountered aorcondition that it was not
configured to handle
Session-6 Debugging Slide 16
Log Message for Debugging
The Step with an error ismarked in red
An explanation of the erroris given
Session-6 Debugging Slide 17
Screen shots of the Error
• A Screenshot option is available on the test editor.
• Whenever a test fails, PTF provides a screenshot of theexecution at that point in time which helps in fixing thefailed steps.
• By default, the option to take a screenshot is enabled;however, it can be turned off.
• Log.SnapShot allows to capture the Screen.
Session-6 Debugging Slide 18
Screen shot- Log
Clicking on the Icon will open upthe Screenshot of the error.
Session-6 Debugging Slide 19
Screenshot- Error
An Image opens upalong with a display ofsequence number.
Session-6 Debugging Slide 20
Highlight Errors
• Highlights the failed steps in a log message.
• A failed step with an error message will be highlighted which
helps locate the failed steps easily in case of a huge shell testfailure.
Highlight errors icon isenabled.
Session-6 Debugging Slide 21
Screenshot
The execution was stopped asstop on Error was enabled.
Session-6 Debugging Slide 22
Training
• Hand out the Training Material
• To be completed in 30 minutes
Discussion
• Walk through the Log
• Explaining the log Results
• Highlight the Key words and lesson learned
Session-6 Debugging Slide 23
Q & A and Comments
Session-6 Debugging Slide 24