In order to automate Oracle EBS Application, we should be aware of some intricacies, out of which one of them is “How to automate Oracle EBS Forms table – iterate between rows”. You can view that a table has 8 / 9 / 10 / etc.. rows filled with data, but in real you have more than the visible number of rows in the UI.
For Example:In the above screenshot you can see, the Oracle EBS Forms table has 8 visible rows, but data in database can be more than 8 rows, if you observe carefully there is a scroll bar on the right side of the window. When you check this manually, you would simply scroll the scroll bar to view other records or set focus on the last row of the table and press “DOWN ARROW” to move to next record.
We will be in a visual illusion that there are more than 8 rows in the table, but technically what it does is there will be only 8 rows visible and the values present in top most row gets vanished and all values present below gets moved up by a row, this will pull the 9th record in to 8th row. This understanding is very important especially when we want to create automation scripts for this scenario.
Now let us see in detail, as how we can automate this situation:
- Consider the name attribute’s value for the field Code in the above window as “KEY_FLEX_CODE_0”, i.e. it ends with “_0”
- Now if you want access value present in 2nd row for the field Code, you need to have the name attribute value as “KEY_FLEX_CODE_1” in the xpath. i.e. by modifying the attribute value in xpath to “_1” at the ending.
- You can continue the same logic till the last visible row in the table, that is till 8th row, and the attribute’s value would be “KEY_FLEX_CODE_7”
- The next part is tricky, when you want to access data present in further rows. I can think of 2 approaches, which I will be explaining below.
Approach 1 – To Automate Oracle EBS Forms table – iterate row by row
- The xpath needs to be dealt carefully, as the number of rows visible in the above Oracle EBS Forms table is constant and will not change, the name attribute value will iterate between _0 to _7 ( considering 8 rows are visible ) only.
- Now, to access data in row 9, you cannot use _8 at the ending of the name attribute’s value, but instead you need to set focus on last row and use “keyPress” api on text field to press “Down” button through code. forms.textField(“xpath to the text field”).keyPress(“DOWN”); // something like this, i currently do not remember the code for “DOWN” , you can check in Help of OATS , for now, will update it once i get the relevant code.
- This will make the 9th row’s data to be visible in 8th row of Oracle EBS Forms table, and now you can use “_7” as the attribute’s value in xpath and retrieve 9th record’s value. What happens internally is the first record gets vanished from top of the table and all rows below shift up by one row, and 9th record appears now in 8th record in the Oracle EBS Forms table.
- This step needs to be continued till all the records in the database are displayed by moving up in the Oracle EBS Forms table.
Approach 2 – To Automate Oracle EBS Forms table – Query by Example
- Other alternative is, you can query a record and run the query to get only those rows which you want to see, this solution is suitable only for the cases when there is no need mandate to access each record sequentially from the Oracle EBS Forms table.
- Set focus on first row , i.e. on any text field and enter and press “F11” to enter in to query mode. ( need to do with OATS code with keypress API)
- Enter a value for any field that you are aware of and press key combination “Ctrl + F11” this will execute the search and presents all the records on Oracle EBS Forms table satisfying the search value provided.
- You can also use the menu operations to perform the above activity instead of short cut keys as well.
- This generally leads to less number of records and it should be easy to retrieve values from visible number of rows ( 8 ), and you need not worry about the way to write complex code to iterate between 9 rows and still access more records.
I hope this article helps you in understanding “How to automate Oracle EBS Forms table – iterate between rows” , in case of any more queries, please feel free to leave a comment, and I would be more than happy to respond.
Founder of TestingTools.co, constantly shares knowledge on different test automation tools. Has experience in building proof of concepts, solutions, frameworks, platforms & implementation of test automation projects.
In pursuit of building a platform with inbuilt framework and reusable components for Oracle Cloud applications ( Oracle HCM, CX, SCM, Financials clouds, Salesforce and other cloud applications )
Major accomplishments in his career:
Product architect and development manager for test automation platforms
Oracle Flow Builder @ Oracle
CloudTestr @ Suneratech
2 times to oracle open world
More than 20 successful POCs ( Proof of concepts )
Designed pricing models.
Trained more than 50 members.
Built more than 100 re-usable functions.
Worked with tools: