Upload
elvin-perry
View
220
Download
0
Tags:
Embed Size (px)
Citation preview
Session Objectives
• Reserved Words and Object type Conditional
• Usage of Reserved Words
• Usage of Conditional Logic
2
Reserved Words
• Reserved Words have special meaning to PTF.
• Each of these words predefined to perform specific functions
when used in a test.Ex.: #TODAY – Applies the current date to the field against which it isentered.
• Reserved words are useful when data is not known before the
test is executed.
• Reserved words enable you to access data available from the
PTF program when a test is executed.
Session 8 - Reserve Words and Conditional Slide 3
Reserved Words
• #DIS#
• #DTTM
• #EXIST#
• #FAIL#
• #CHECK#
• #LIKEF
• #LIKEW#
• #NOTEXIST#
• #PREFIX#
Session 8 - Reserve Words and Conditional Slide 4
Reserved Word – #DIS#
• Verifies a value and checks whether the object is display-only.
• Logs a Fail if the object is not display-only
• If you use #DIS# without a value, then the value isignored and #DIS# only checks for whether the field isdisabled.
• This reserved word is useful when, the object is visiblebut not editable.
Reserve Word#DIS#
Session 8 - Reserve Words and Conditional Slide 5
Reserved Word – #DTTM
#DTTM
Populate current date and time into a field.
Reserve Word#DTTM
Session 8 - Reserve Words and Conditional Slide 6
Reserved Word – #EXIST#
• Verifies a field exists and return the Value ‘Pass’ if fieldexists else ‘Fail’
• If a value is passed, set the field to value.
Example• The first step checks for whether the designated Work Location Id
field exists in the application and logs a fail if it is not found.• The second step not only checks for the existence of the field; it
attempts to enter the value 003 into it.Reserve Word#EXIST#
Session 8 - Reserve Words and Conditional Slide 7
Reserved Word – #FAIL#
• Performs comparison but does not update the value.
• A Fail is logged if value is not matched else a pass islogged
Similar Reserved Word - Check
Example• In this example, the PTF logs a fail if the Desig Work Location Field
is not equal to 003.
Reserve Word#FAIL#
Session 8 - Reserve Words and Conditional Slide 8
Reserved Words- #CHECK#
• Performs Comparison in an object against the expectedvalue.
• Updates the value if data does not match
• Would not update the value if data matches
Example• In this example, the PTF sets the value to KUSPTEST
Session 7 - Reserve Words and Conditional Slide 9
Reserved Word – #LIKEF# (LikeFail)
• Look for Similar Values, not an exact match
• Similar match is not found, it logs a Fail.
Type of Match Pattern Match (Log a Pass) No Match (Log a Fail)
Multiple characters a*a aa, aBa, aBBBa ABC
Multiple characters *ab* abc, AABB, Xab aZb , bac
Multiple characters ab* abcdefg, abc cab, aab
Reserve WordExample #LIKEF#
• Some fields contain the current date and time. Use the #LIKEF##TODAY*
Session 8 - Reserve Words and Conditional Slide 10
Reserved Word – #LIKEW# (Like Warning)
• Look for Similar Values, not an exact match
• Similar match is not found, it logs a Warning.
ExampleReserve Word
Matches the wild card string, the status is Green #LIKEW#
Status of thecomparison #LIKEW#
Session 8 - Reserve Words and Conditional Slide 11
Reserved Word – #LIKEW# (Like Warning)
• Look for Similar Values, not an exact match
• Similar match is not found, it logs a Warning.
ExampleReserve Word
When the wildcard string does not have similarvalue#LIKEW#
Status of the comparisonwhen does not match
Session 8 - Reserve Words and Conditional Slide 12
Reserved Word – #NOTEXIST#
• The opposite of the #EXIST# reserved word,#NOTEXIST# verifies that a field does not exist.
• If the field does not exist, a Pass is logged, else a Fail islogged.
Reserve Word#NOTEXIST#
Session 8 - Reserve Words and Conditional Slide 13
Reserved Words – #PREFIX#
• Substitutes the text in the Prefix field in the Test Editor for the
#PREFIX# string in the value field.• Appends the text if #PREFIX# reserved word is used at the
beginning of the text in the Value field.• This substitution enables to modify test data.
• This substitution is useful when same test has to be run ondifferent employee id’s or on different effective dates.
Prefix – Mail ID
Session 8 - Reserve Words and Conditional Slide 14
Reserved Words – #PREFIX#
• Using #PREFIX# reserve words, the effective date value coule
changed and used in the Test
Prefix – Eff. Date
Session 8 - Reserve Words and Conditional Slide 15
Object Type – Conditional
• Conditional logic enables PTF it to take action based onfulfillment/non- fulfillment of a condition.
• Action ‘If_Then’ – Validate the given Condition
• Action ‘End_If’ – Close the Statement of ‘If_Then’
• Between the above two statements, the set of steps whichcan be executed when the condition is correct.
• ret=&variable - returns the value of the field acted upon intothe variable.
• ‘Else’ is not available. Nested condition cannot be performed.
• Online Page Field cannot be used to compare the value.Value should be retrieved from the Field name and assign it to
Variable.
Session 8 - Reserve Words and Conditional Slide 16
FLOWCHART OF CONDITIONAL LOGIC
PTF Steps
True
Condition
False Steps Executed
Rest of PTF Steps
Session 8 - Reserve Words and Conditional Slide 17
Steps to add Conditional Logic
Record the test and save it
Go to the Test Editor and insert a new row
Make a note of the field which needs to be verified
Type/Exist – to verify the field/button etc.
Under recognition, give the field name followed by ret=&var(Returns value to Variable)
Conditional/If_Then – to apply a condition to the variable
Enter the action to be performed in the next row, if theconditional holds true
Conditional/End_If – to end the conditional
Session 8 - Reserve Words and Conditional Slide 18
Online Page – ConditionalConcept:Special steps based on the information gathered from the application during a test
If the work location codeis blank then it is filled
Session 8 - Reserve Words and Conditional Slide 19
Object Type – Conditional
Concept:How to use the Object Types,Actions : Conditional,If_Then,End_If
Conditional If Then &Var=/<> Value&x1 = ‘075’
Conditional End If
Session 8 - Reserve Words and Conditional Slide 20
Object Type – Conditional
Concept: Syntax for If_ThenHow to use the Object Types,Actions : Conditional,If_Then,End_If
If_Then supports these logical operators:
<>, >=, <=, >, <, =
Format/Syntax
Conditional.If_Then
Enter Condition in Recognition Column.
Session 8 - Reserve Words and Conditional Slide 21
Log – Conditional
Session 8 - Reserve Words and Conditional Slide 22
Business Usage – Conditional
The following are examples of various business cases where theconditional logic has been used in PTF:
• While hiring a person, on entering his name, if duplicate
names are found, then a message pops up which is tackledthrough conditional logic.
• While modifying the Job Code in Job Data of a Person, if the
Job Code has a Union Code, then other Union fields such asUnion Seniority Date are filled.
Session 8 - Reserve Words and Conditional Slide 23
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 8 - Reserve Words and Conditional Slide 24
Q & A and Comments
Session 8 - Reserve Words and Conditional Slide 25