Fortunately you can configure quite a few settings in your project's web.xml file to make it more development friendly. I've written about these before but some are even more important for automated testing. The ADF Faces documentation also states a number of configuration changes have to be made for automated testing.
These are the settings to change when using automated testing:
oracle.adf.view.rich.automation.ENABLEDshould be set to
clientComponentattribute on the JSF component. This makes interacting with the page from Selenium much easier. It also seems to enable some other client and server side features. Search for
isAutomationEnabledin the ADF source code to get a feeling for things that will change when enabling this. One of the things it enables is to find objects using scope IDs (also known as Sub IDs). This is explained in the Oracle Application Testing Suite Open Script User Guide.
For this to work you also need to put adf-richclient-automation-11.jar in your project classpath. The simplest way is to just put this JAR in the WEB-INF/lib folder of your project. The file itself can be found in JDEV_HOME/oracle_common/modules/oracle.adf.view_12.1.3/
truein web.xml which will disable the compression of CSS classes like
af_buttonto something like
x7k. Having readable and deterministic CSS class names makes it possible to use CSS selectors in your Selenium scripts.
Developmentin web.xml as your application will otherwise fail to start since you have enabled a number of development-only features. You can revert this to
Productionwith deployment plans for other environments.
- The aforementioned Oracle Application Testing Suite documentation also advises to set
AdfPage.PAGE.setAnimationEnabled(false)on each page for situations where we forgot to set this parameter. Unfortunately values in
trinidad-config.xmlcannot be overridden with deployment plans, but there is a neat trick where you can refer to web.xml context param values from
You can revert these settings to the optimised values with deployment plans. No need to change this in the source code or build artefact each time. Just set the development optimised versions in your source files so local runs in JDeveloper use the correct values. Then use deployment plans to override these for production and other environments.
This post is part of a series on how to use Selenium automated tests with Oracle ADF.