Apollo Demapping Guide

The RFT Object Map

In RFT the Object Map followed a trend where GUI objects could be learned once and kept in a repository and reused. The elements in the object map contained recognition properties that were then used in subsequent find operations. The maps where typically generated during RFT test script recording, but could also be created and edited manually.

Selenium has no concept of a library of identifying properties, so some Selenium frameworks are based on the page object model. There is no good way to access the RFT Object Map without the real RFT API. At the moment, if you access RFT Object Maps in your scripts then the strategy is to demap your script. Which is actually quite straigtforward to do, and preserves all the structural integrity of the test logic as its done "in-line" with your script.

What To Do

If you're using an Object Map reference in your script it will look something like this:

placeOrder().click();

There is an implicite find() going on to supply the element and then apply the click() method. Demapping just means to replace the "placeOrder()" with an explicit find() using the appropropraite properties as referenced in the map.

How To Do It

In the figure above, see the "placeOrder" button. Let's edit it.

We can see immediately that it is an object with a class of "javax.swing.JButton", facing text of "Place Order" and an internal name of "placeOrder".

In order to create a Selenium compatible find function we edit the line:

placeOrder().click();

to become

root.find(atDescendent(".className","javax.swing.JButton", ".text", "Place Order")).click();

With this object in hand we can now click it, producing the same result without the Object Map.

This is still an IBM RFT command structure and therefore you can run your tests in RFT and confirm that they still work, prior to running them in Apollo. This is architectually the direction that you will need to take to use Selenium.

In Selenium the basis of the element find mechanism, is the name/value pair structure. This is used to search the DOM and retrieve the elements. Replacing your RFT Object Map is a step towards learning to use Selenium like find structures.