Upload
patricia-richardson
View
235
Download
0
Tags:
Embed Size (px)
Citation preview
Session Objectives
• Object Types – Query, HTML Table
• Purpose of the Query and Explanation
• How to add a Query to a PTF Test Case
2Session 5 - Query
Purpose of Query in PTF
• Query is one of the few ways of obtaining data from
records, and providing inputs in PTF.
• Query needs to be created in advanced, and stored in
PeopleSoft.
• PTF allows us to run preexisting query through Query
Viewer.
• After a query is run in PTF, the output is opened in
HTML format, and required data is picked up using acombination of PTF functions.
Session 5 - Query Slide 3
Recording a Query in PTF
Navigate to Query Viewer page
Enter the query name and click on search
Click on the HTML link in the search results andstop recording
Output opens up in a new browser in a gridformat
Drag the hand icon in the status bar (yellowcolored) over the required cell
Make a note of I/R/C value, which is nowvisible in the status bar
Point to Note: I/R/C stands for Index/Row/Column which refers to particular cellcoordinates in a grid. Ex: 5/2/2 refers to Index=5, 2nd row and 2nd column
Session 5 - Query Slide 4
Steps to Run a Query – PTF Editor
In order to retrieve data from the query, the following steps needs to beadded to the test editor manually.
Browser/Wait for New ( Wait time in seconds isprovided) – To open up a new browser
Browser/Frameset – To set the cursor to a specific field
HTML Table/Cell Get Value : index=I/R/C, ret=&var.(This cell value into the variable)
Browser/Close – To close the current browser window
Browser/Frameset – To pass control back to the initialbrowser window
Session 5 - Query Slide 5
Step1 : Record Query in PTF - How to Pick the output data
• Open a PTF Message Box – From Menu, Tools - > Message.It opens the Message Box
• Create a New Test & Start Recording• Go to Query Viewer and Select a Required Query(Give the
Full Query name). Don’t use partial Query name• In order to run a query in PTF, the query output needs to be
opened up in HTML format.• Stop Recording• A new browser page opens with the output in the grid format.• Drag the hand icon available on top of the cell whose value
needs to be picked up. Pick the I/R/C value and assign to avariable.
• I/R/C value of the cell in the yellow bar, as shown above.• Close the HTML Output
Session 5 - Query Slide 6
Step1 : Record Query in PTF - How to Pick the Output Data
• Click on the Initial Browser window (Control on the Browser)• Go to PTF Test Editor & Keep the Cursor after Link.Click of Query
Run
I/R/C Value
Hand Icon
Session 5 - Query Slide 7
Step 2 : Add Query Steps to Test Script
• Enter Browser.WaitforNew• Enter Browser.FrameSet as given below
Query NameQuery Run Button Query Navigation
Waiting for Query toComplete
Session 5 - Query Slide 8
How to Assign a Variable
• A variable is used to store and apply the values. A
variable name starts with an ‘&’.
• In the test editor, add a row with Object Type | Action -
HTML Table/ CellGetValue.
• In the recognition column, enter index= I/R/C; (value of
the cell picked up before).
• This is followed by ret= &var; (to retrieve the value of
the cell in this assigned variable).
Session 5 - Query Slide 9
Step 3: Add Steps to Select Value From Query ResultObject Type – HTML Table
• HTML Table – Object Type
•CelGetValue – Action - Returns the contents of a HTMLTableCell
( Retrieve data from the Query Results)Variable
HTML Table
CellGetValue
Session 5 - Query Slide 10
Step 4: Assign Variable to Test Script
• Identify the field where the variable needs to be placed.
• Use Object Type |Action Type – Text|Set_Value to assignthe value.
• In the value column, place the &var.
• This will populate the stored value while running theThe variable name is placed.online test.
Value of variable isplaced.
Session 5 - Query Slide 11
Online Page
Navigate to Query Viewer page.
Query name is entered in search.
Run to HTML is clicked.
Session 5 - Query Slide 12
Query Output Opens up in new browser
The current cell refers to 5/2/2, andhence this emplid will be picked up.
The status bar shows the I/R/Cvalue of the cell currently selected.
Session 5 - Query Slide 13
PTF Test Editor - Query
Query Name
Opens up the new browser window
The query output isreturned in a variable
Session 5 - Query Slide 14
Business Usage
Query can be used in following scenarios:
• To make any test case/process dynamic
Ex.: For any job data changes on any hourly employee, a random emplidcan be picked up using a query to pick.
• To pick up data from one table to be put in another table
Ex.: Query job code table to pick up a job code, to be put in job datapage.
Session 5 - Query Slide 19
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 5 - Query Slide 20