Many a times when working with Oracle EBS forms, automation test engineer wants to bring forms to base state and continue with next steps, this can be achieved very easily using OATS. There is an api given as part of forms object, which is getAllOpenWindows(), this method in forms returns List of AbstractWindows, you can write a for loop to navigate through all windows and check if the name attribute is not navigator and close all the forms other than navigator.
For users convenience we are giving a ready made function for the above purpose.
Code Snippet for bringing Oracle EBS Forms to Base state by closing all open windows except for Navigator Window
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
public void formsBaseState() throws Exception { // get all open windows in the current state of execution AbstractWindow allwindows[]=forms.getAllOpenWindows(); //iterate through all windows and close all the windows except for the navigator window for(int i=0;i<allwindows.length;i++) { // check if the current window is not a navigator window if(allwindows[i].getAttribute("name")!=null && !allwindows[i].getAttribute("name").equals("NAVIGATOR")) { if(allwindows[i].exists()) { allwindows[i].activate(true); String nm=allwindows[i].getAttribute("name"); forms.window("//forms:window[(@name='"+nm+"')]").selectMenu("File|Close Form"); think(2); } } } } |
Note: the above code snippet works for a pure positive case when there wont be any issues in closing each window, you could add additional code to handle situations where windows like Caution Window / Alert Window / Decision Window might appear whenever each window is closed. Just make sure that the function may not get delayed.
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 )
100 demos
Designed pricing models.
Trained more than 50 members.
Built more than 100 re-usable functions.
Worked with tools:
OATS – Oracle applications testing suite
Selenium + Java / C#
Protractor
NightwatchJS
CodedUI
PyWinAuto
thank you so much.