Home > adf, jsf, software engineering > ADF app param “oracle.adfinternal.view.rich.region.dynamicClientId.DISABLED”

ADF app param “oracle.adfinternal.view.rich.region.dynamicClientId.DISABLED”

I was asked recently to make a proof of concept for automated functional testing. The tool we decided to test is Selenium. Selenium is a really easy, powerful and fast testing framework that allows to run GUI tests in different environment (browser, os, language). I will not go into details into this post, but if you are not familiar with the tool, it provides a Firefox add-on with which you can record every UI interaction you have and save it in a test case file. After that, you might want to reopen your test case and execute it. This can be very useful for regression testing as part of your automated build process (we use maven and hudson in our case).

When you use the Firefox IDE to record your test, it adds a list of command in your FF context menu to accelerate your test case development time. However, to retrieve the UI elements on the page, Selenium is using the ids on your elements. In ADF, it is strongly suggested set the “id” attribute on every JSF component. If you plan to use selenium, this becomes essential, because you don’t want the ids to change from run to run.

I encountered a problem in the case where my test case included a region component. The region component were generating an additional id after the one I specified, for example:

<af:region id="regionX" model="#{bindings.myTaskFlow.regionModel}"/>

would sometime render as

<div id="regionX:0"></div>

sometimes as

<div id="regionX:1"></div>

After some investigation, it was discovered that the region component is adding a dynamic container clientId for every page fragment in use at the same time in the region. I guess the ADF team had a reason to add this behavior, but for the moment, I’m glad they added a parameter to disable it and avoid that thoses ids change from run to run, enabling us to build selenium test cases. Just add it to your web.xml:


<context-param>
 <param-name>oracle.adfinternal.view.rich.region.dynamicClientId.DISABLED</param-name>
 <param-value>true</param-value>
 </context-param>

I’m just unaware for the moment of any side effects it might have, but hadn’t find any yet.

Advertisement
Categories: adf, jsf, software engineering Tags: , ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.