When using the RQM/RFT integration, you may run into a problem running RFT scripts from RQM when using Shared Location, which results in this error:
The script cannot be executed
You have this problem even though the RQM/RFT integration is set up correctly and the RFT script itself works fine.
RFT scripts run from RQM fail with the "The script cannot be executed" error, but the same scripts run from RFT itself work fine.
If you reconfigure the problem script to use Local instead of Shared Location, the script runs fine from RQM.
In the RQM adapter console, the RFT command used by RQM has a UNC or network path in the -datastore switch instead of a local path to a local temporary location.
This problem happens on machines that are missing a Microsoft VC++ Redistributable required by RFT's RQM adapter, which prevents a DLL file (rftrqmcomm.dll) from loading. The RQM adapter relies on rftrqmcomm.dll to get the temporary location where RQM copied the RFT scripts that were in the shared location. The -datastore switch of the RFT command used by RQM should never have a network path as its value -- if it does, that indicates a problem with the integration or the system hosting the RQM adapter.
How to determine whether you are having this problem
Enable debug logging for the RQM adapter. Then start the RQM adapter, reproduce the problem, and check the RFT command used by RQM -- if the -datastore switch has a network path, you might be having this problem. Proceed to the next step.
With the RQM adapter still running, start Process Explorer and use its Find command to search for rftrqmcomm.dll. If nothing is found, that indicates this DLL was not loaded by the RQM adapter, and that you are having this problem.
(If you cannot run Process Explorer but the test from #1 indicates you may be having this problem, go ahead and follow the steps to resolve the problem.)
Resolving this problem
The RQM adapter requires a new enough version of the 32-bit Microsoft Visual C++ 2005 Redistributable. This can be obtained here. Installing the missing redistributable will resolve this problem.
IBM Rational Functional Tester (RFT) is all about object recognition. If the graphical user interface (GUI) contains objects that Rational Functional Tester recognizes, you can record a sequence of actions. You can replay this sequence afterward.
This post wants to introduce you to object recognition in Rational Functional Tester.
The heart of object recognition in Rational Functional Tester is the object map. The object map is a graphical representation of the objects in your application under test that Rational Functional Tester encounters.
Through Windows hooks, Rational Functional Tester memorizes what actions you played in the GUI. Here, a hook means a mechanism that works between the keyboard or mouse and the GUI object.
Let’s say, when you click an object, information about that object flows from your video chip to the memory of Rational Functional Tester. During recording, Rational Functional Tester stores the information that the hook gathered.
For more information about hooks, see the following document on Microsoft.com.
When you finished recording, Rational Functional Tester puts the information about the objects into a kind of table. This table shows the objects of your application in a parent-child view. We call this table the object map.
With this object map, you can manipulate the way Rational Functional Tester recognizes the objects in your application under test. In this way, you can fine-tune your script to play back more easily, for example.
Roughly, the object map contains the following information about the objects that you touched during recording: administrative properties, recognition properties.
The object map displays the name that the developer gave to the object.
The name that you in the application’s graphical interface.
If you look at the picture, the domain is the first information that the object map reports about an object. In this example, we’re talking about a Java application. Therefore, the domain is Java. If the application runs in a browser, the object map would say HTML. The domain must match with the type of application under test.
These values are the properties that the recorder collects. These properties make the object unique. Therefore, when you run the script, Rational Functional Tester recognizes the object without ambiguity.
The recorder also assigns a weight. The weight says how important a property is for recognition. If you want, you can change the weight of any recognition property. In this way, you decide yourself what property is important for recognition.
In the sample application Classics Java, you can see the following properties of the Place Order button.
Unique ID: 1.3kaXiXo9H95:AQpC:Pyg70l9:8WW.
You can also see that the most important properties for recognition are the class name, accessible name, and name.
What to do with the object map
In the Rational Functional Tester Script Explorer, you see two kinds of test objects. You see an icon with caption Private Test Object Map. As the name “private” says, these objects belong only to that script that you recorded.
You can also make an object map that you can share with other scripts. With such a shared object map, you can change the object properties in a single place instead of all the private object maps. To create a test object map:
Right-click your project > Add Test Object Map.
When you right-click an object in the object map, you see a set of action that you can apply to the object. The most important are the following items.
Highlight test object
Insert test object
Highlight recognized objects
If Rational Functional Tester recognizes an object properly, you can highlight that object through the object map. Watch the video to see how that looks like.
Insert test object
If your application has an object that you didn’t record, you can still add these objects to the object map. Now, Rational Functional Tester can recognize the object when you run a script where the object does play a role.
Is there a better way? find() method
Sometimes, the object map is not an option. Sometimes manipulations on the object map are too tedious. Sometimes, the object map doesn’t contain an object that you want to play back. Then, the find() method is the way to go.
You can start with the class of RootTestObject. This class gives you access to your application. So to say, RootTestObject opens the objects of your application under test.
Let’s look at the syntax first. I show an example later.
public TestObject find(Subitem properties, boolean mappableOnly
For Subitem, you can use the following items.
A name or value pair that represents a TestObject property.
Contains properties that match with the direct child of the parent TestObject.
Contains properties that match with children or objects under the children of the parent TestObject.
Specifies a sequential properties list that match with atList.
public TestObject find(Subitem properties, boolean mappableOnly)
//Define window and find Place Order button RootTestObject root = RootTestObject.getRootTestObject(); TestObject matchingObj = root.find(atProperty("name", "placeOrder"));
The video shows how you can click the button Place Order in the sample application through the find() method. The find method is a different way to a click from a click through recording. In the video, you can watch the following steps.
Open the application under test.
Create an empty script.
Open the empty object map.
Click Insert Objects … to populate the object map.
Drag the object finder, the hand, to the caption bar of the application. This action casts a red rectangle around the entire screen of the application.
Select Include all available objects on this window. Then, click Finish.
Locate the Place Order button in the object map. Then, click Save.
Insert the following code into the script. This code makes the objects available in the application window.
Rational Functional Tester does not support custom objects.
When something is wrong with the object recognition, you see that the object map either doesn’t list the object and the Test Object Inspector doesn’t see the object. Also, when you see Win.GenericProxy or HTML.Generic.Proxy in the object map, you are dealing with a custom object. When you play back the script, you notice. For example, you get an ObjectNotFoundException.
From my experience, I would first check whether Rational Functional Tester recognizes the objects in the right kind of application. In other words, what domain the object map assigns to the objects. For example, the object map must say HTML for objects in a web browser.
If the domain is the right domain, you can see whether you can highlight the object through the object map. See the video in this post.
What to do with objects not in the object map
With the find method, you can also try to discover an object that Rational Functional Tester recognizes but doesn’t put in the object map. You can see these objects through the Test Object Inspector.
If you set the Test Object Inspector in the Options menu to not hiding objects that are not mapped. If you want to find objects that are absent in the object map, use the mappableOnly parameter. Now, you say that the Boolean value is false.
Object recognition is an important condition for Rational Functional Tester to work. A central role in the object recognition is the object map. You can manipulate the object map or use the find method.
I hope that I explained how the object map works and what you can do to improve object recognition.
If you’d like to share your experiences with object recognition in Rational Functional Tester, leave a comment here or follow me on Twitter.
For IBM Rational Functional Tester, you need to be an admin user under Windows or sudo user under Linux. The reason is simple: Rational Functional Tester is a tool that is designed for usage under an admin account. Also, the verification and validation of Rational Functional Tester at IBM happens under an administrative account.
However, in the real world, situations arise where you suspect security breaches when you grant users administrative rights. Think of banks or other financial institutions where names with corresponding amounts of money are stored in the same table. This highly confidential information must not come into wrong hands. The fewer people have access, the more secure this information.
Nothing to write home about Broadly speaking, you do the following things with Rational Functional Tester.
Except for the latter action, Rational Functional Tester writes data into files outside your user folder. For installation, it's quite obvious that you need to have admin rights. After installation, you prepare the testing environment first before you test your applications under test.
To configure your applications for testing, you need to write into files. For example, to prepare Internet Explorer for testing, you need to enable Internet Explorer and the Java runtime environment (JRE). To perform these tasks, you write into files that are outside your user folders. Then, an administrative account is necessary.
One of the files you need to write is the following configuration file in Windows.
To run tests, Rational Functional Tester needs to run various processes and writes in folders outside the user folder. In one case, the Rational Functional Tester team got an error message that cmd.exe was necessary to run a script. After the system administrator granted permission, the script suddenly ran and completed.
You also need permission to the SDP\configuration\org.eclispe.osgi folder, a subfolder under the Program Files folder. During script run, Rational Functional Tester writes into this folder.
A few years ago an organization that executes social laws in a major European country contacted me to ask how to run Rational Functional Tester under a normal-user account. The reason was obvious: privacy laws prescribe secrecy about a person' s benefit. For example, it is nobody's business that person x got so much unemployment benefit for this period.
The Rational Functional Tester development gave directions of what Rational Functional Tester expects in terms of write privileges in Windows. Then, I tried to implement their directions in the organization's desktop computer. We got Rational Functional Tester working under a user with fewer privileges than an administrator after trial and error. Luckily the organization's team had a network administrator who was willing and able to grant the permissions directly without tedious procedures.
The following document describes the technical details.
If your company or institution stores confidential information, you want to restrict access to this information. In any case, you store this secret information in highly secured file servers or database servers rather than in desktop computers. Rational Functional Tester as a desktop application runs on a desktop. As long a desktop user doesn't have access to your servers, the users cannot access the data that is entrusted to you. Suppose that you have a Windows domain. What would happen when you create a group of Rational Functional Tester users and put that group into the local administrators group? The latter group is only in the domain users group. Is this configuration secure?
In short, you can run Rational Functional Tester without full admin rights. You must make certain folders accessible for read and write and maybe other arrangements as well. However, it might work better if you work under admin right. KISS it, keep it simple & straightforward.
If you'd like to share your experiences with running Rational Functional Tester under a normal user, leave a comment here or follow me on Twitter @gunangwaney
You may be interested in finding the RFT version from many different machines -- for example, as part of an upgrade plan in an environment with a large number of users. You can automate this by having your script check Installation Manager's installed.xml file on the RFT workstation.
The installed.xml file will have this string if the workstation has RFT installed:
IBM® Rational® Functional Tester
The next line after the "IBM® Rational® Functional Tester" line will have the RFT version. Here are some sample lines for version 8.6.0.x of RFT:
Version 18.104.22.168 (8.6.7.RFTO8607-I20160302_1156)
Version 22.214.171.124 (8.6.3.RFTO8603-I20150303-1742)
Version 126.96.36.199 (8.6.6.RFTO8606-I20151126-1840)
Depending on how you want to do your check, you can pick a subset of the version string common to all 8.6 versions, for example:
We recommend verifying that installed.xml includes "IBM® Rational® Functional Tester" before doing the actual version check.
Other RFT versions have similar naming conventions as 8.6. For example:
IBM® Rational® Functional Tester
Version 188.8.131.52 (8.5.1003.RFTO8513-I20140506-1125)
IBM® Rational® Functional Tester
Version 184.108.40.206 (8.3.2.RFTO8302-I20130323-1322)
We recommend that you verify the string formatting in your local installed.xml files to verify your version of Installation Manager is displaying these strings as you expect them.
The location of the installed.xml file depends on your Installation Manager configuration. If you do not know its location, you can determine it from Installation Manager as follows:
Start Installation Manager.
Do Help > About Installation Manager.
Click the Installation Details button.
The value of cic.appDataLocation is the path where installed.xml is located.
During RFT installation, sometimes you might have encountered the below error in IBM Installation Manager.
Error during "post-install configure" phase:
Error executing the C:\ProgramFiles(x86)\IBM\RFT\FunctionalTester\installscripts\installInternal.bat command:status=255.
The below message could be found in the installation manager log file located in C:\ProgramData\IBM\Installation Manager\logs: C:\ProgramData\IBM\RFT\customization XCOPY is not recognized as an internal or external command, operable program or batch file.
cacls is not recognized as an internal or external command, operable program or batch file.
To resolve the post-install configure error during installation you can try following the below procedures one by one:
Launch Installation Manager with Run as Administrator privilege to install RFT:
Click on Start > All Programs > IBM Installation Manger.
Right click on 'IBM Installation Manger' and select 'Run as Administrator' option
Clean un-installation of RFT:
Uninstall Rational Functional Tester from IBM Installation Manager.
Open the Windows Registry editor. Go to HKEY_LOCAL_MACHINE\SOFTWARE\Rational Software\RationalTest and take a backup and delete the entire 8 Folder under it.
Uninstall IBM Installation Manager from control panel.
Remove all files and folders under Rational Functional Tester installation directory, for example: C:\Program Files (x86)\IBM\SDP
Navigate to C:\Users\IBM_ADMIN\AppData\Roaming\IBM and remove Rational Functional Tester folder.
Navigate to C:\ProgramData\IBM\RFT and remove customization and configuration folder.
Restart the computer.
Try to install RFT to a path without spaces and special characters:
During installation, change RFT installation directory to a path without spaces and special characters (For Example. D:\IBM).
Use a new User credentials:
Create a new User with administrator privileges and login to the machine with this new user.
So many factors will affect the automation script play back when you are interacting with application GUI. Once such instance is, where play back fails when RFT tries to perform click action on hyper link control (could be any other control). Though this issue does not consistently happen it might happen intermittently due to application loading speed, RFT play back speed, Application Program Interface (API) used or some other factor as well.
RFT provides API such as sleep(), watiforexistance(),IsVisible().... using which you can handle the play back failure due to above said behavior, however if the issue is not consistent and occurrence of the issue is minimal, introducing sleep() API would consume additional time which could be avoided.
Test Script consist of steps which performs inserting text into number of text fields and then clicking on button, which takes the application to the next page, where RFT needs to perform click action on hyperlink upon loading .
Though the application page has not loaded completely (half page visible to the user), the expected hyperlink control is visible on the screen and RFT tries to perform click action on the control. The moment RFT is about to click, the pages loads completely that makes hyperlink control to move elsewhere and that makes RFT to click on unexpected control which leads to the failure.
Textfiled1.setText(" Name" ) ;
Textfiled2.setText("Address" ) ;
Textfiled3.setText("City" ) ;
Execution of above code snippet might replicate the scenario that we are discussing.
In order to overcome this issue, before performing click action, use getScreenRectangle() API to find the middle point of the control co-ordinate.
By doing this, play back failure could be avoided as RFT relies on co-ordinates of the test object ( not the screen co-ordinates so this script must run in any resolution or screen size )
java.awt.Rectangle r = Hyberlink_AddnewEntry.getScreenRectangle();
java.awt.Point pt = new java.awt.Point(r.x+ r.width/2,r.y+ r.height/2);
During RFT installation, you might encounter the below error
rtivregister.exe - Common Language Runtime Debugging Services
Application has generated an exception that could not be handled.
Process id = XXXX, Thread id = XXXXX
Click OK to terminate the application.
Click Cancel to debug the application.
After clicking OK , RFT installation would be carried out; however you will not be able launch RFT on the machine.
In Windows Registry Editor, under the HKEY_LOCAL_MACHINE\SOFTWARE\Rational Software\Rational Test\8 path, Rational FT Net Assembly Name key would not have created.
To resolve the error during installation you can try following the below procedures
1. Contact IBM Support for obtaining a new rtivregister.exe file. You can raise PMR through SR tool.
2. Install base version of RFT ( RFT 8.6 , 220.127.116.11 or 18.104.22.168. Ignore the error popup message during installation.
3. Take a backup of the rtivregister.exe file present in RFT bin directory located in C:\Program Files (x86)\IBM\SDP\FunctionalTester\bin directory file and replace it with the one obtained from IBM
4. Launch command prompt with 'Run as Administrator' privilege and navigate to the bin directory.
5. Run rtivregister.exe and confirm that Rational FT Net Assembly Name key is getting generated.
For upgrading RFT, you can replace the rtivregister.exe with the original file and perform the upgrade process by ignoring the error.
After upgrade, continue the steps 3 to 5 to complete the installation.
You might encounter a situation where RFT is unable to recognize a vb.label control in a Visual Basic (VB) application using descriptive code.
RFT is able to find the control using the recorded script. However, the regular descriptive find() code ( shown below) is unable to recognize a vb.label control.
TestObject findlabel = (findwindow1.find(atDescendant(".class","Label", "Name","Label1" )));
Properties of the vb.label control in object map:
The below shown modified find() code snippet helps to recognize the vb.label control using descriptive code:
public void testMain(Object args)
RootTestObject root = getRootTestObject();
ALL SOURCE CODE AND/OR BINARIES ATTACHED TO THIS DOCUMENT ARE PROVIDED "AS IS," WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT OF PATENTS, COPYRIGHTS OR OTHER PROPRIETARY RIGHTS OF OTHERS. NEITHER THE AUTHOR NOR IBM WARRANT THAT THE FUNCTIONS, ROUTINES, AND DATA CONTAINED IN, OR GENERATED AS A RESULT OF THE DOWNLOAD(S), WILL MEET YOUR REQUIREMENTS OR BE ERROR-FREE. The entire risk related to the quality and performance of the download(s) is with you. In the event that there is any defect, you assume the entire cost of all necessary services, repair or correction. IN NO EVENT WILL THE AUTHOR OR IBM BE LIABLE TO YOU OR TO ANY THIRD PARTY FOR ANY DIRECT OR INDIRECT DAMAGES (INCLUDING, WITHOUT LIMITATION, LOST PROFITS, LOST SAVINGS OR OTHER INCIDENTAL OR CONSEQUENTIAL DAMAGES) ARISING OUT OF THE USE OR INABILITY TO USE THE DOWNLOAD(S), EVEN IF THE AUTHOR OR IBM HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Some jurisdictions do not allow the exclusion of implied warranties or the limitation or exclusion of liability for incidental or consequential damages, so some of the above may not apply to you."
While executing Rational Functional Tester (RFT) scripts, “Java version out of Date” Pop Up could come up. This could halt the the proceedings.
This is a Java security protocol to help user to remind and upgrade to the latest JravaRuntime (JRE). This cannot be disabled or cannot be handles as unwanted windows.
Here's a workaround that might help!
You can run the Java Control Panel as administrator, and then make changes to the Java update settings. Schedule the update
notification to the desired time and avoid untimely notification. Note: Running the Java Control Panel as administrator is necessary even if you are a user with administrative privilege with User Account Control (UAC)..
Follow these steps to run Java Control Panel as administrator.
Click Start. In the Start Search box, type command.
A list of matches will appear. Right-click Command Prompt in the Programs list.
Click Run as administrator
4. To open the Java Control Panel, in the Command Prompt window type: "c:\Program Files (x86)\Java\jre6\bin\javacpl.exe"
5.In the Java Control Panel, click on the Update tab.
6.Check the checked box for “Check for Updates Automatically” and click on Advanced Tab.
7.Change the update notification settings by selecting option to when you want your system to ask for java version out of date popup for example weekly, daily or monthly and at time for the same is also configurable.
Note: If you are not logged in to system as administrator then options to change Java update notifications will be disabled and you will not be able to make changes.
In my experience, there are a couple of ways you can try to resolve this. During playback, you can try following the below procedures in an RFT script. An alternative is to use a test machine to increase heap size, find those
Functional Test Script:
1. Unregister the test objects used in the scripts, once the scope of the test object ends.
This can be achieved by calling unregisterAll() API at the end of each test scripts.
Refer the techhote 1507963 which explains about the usage of unregisterAll() method in RFT
2. Use the cleanup() API in each script to clear the Garbage collector data. This API also can be called at the end of each script.
On a Test Machine:
1. Close RFT and make sure there are no Javaw.exe processes running in the task manager.
2. Go to Start > Run > %temp% and clear all the temp contents.
3. Go to the Workspace directory and take a backup of the .metadata folder (if it exists) and delete it.
4. Increase Spy Heap Memory in registry editor:
Add a DWORD in registry to increase the SpyHeapSize. (Refer technote 1318359)
5. Increase JVM heap size in the eclipse.ini file present in RFT installaton directory located in C:\Program Files (x86)\IBM\SDP\ folder.
(for example increase it to 2044) -Xmx2044m
(Default value would be -Xmx1024m, make sure that your machine has enough memory to increase the JVM heap size)
6. Set a clean initialization of RFT by adding the -clean switch in the shortcut Properties of Eclipse Scripting.
Go to Start > All Programs> IBM Software Delivery Platform > IBM Rational Functional Tester > Right Click on Eclipse Scripting> Properties, append the target with -clean as below:
"C:\Program Files (x86)\IBM\SDP\eclipse.exe" -product com.ibm.rational.rft.product.ide -clean
7. Restart the machine and trigger the playback again
You might encounter an issue where RFT 8.6 fails to recognize the Screenpoints of Html.INPUT.text control launched in Mozilla Firefox web browser
RFT is able to record the actions from the Html.INPUT.text control. Even Test Object Inspector is able to retrieve the properties correctly.
However,during playback, RFT fails to retrieve the screen coordinates of the control and the playback fails with 'No screen point found' error.
Even, Insert Test Object wizard highlights the control in the left hand side top most corner of the page.
We've found that this issue is reproducible only with Mozilla Firefox web browser; but oddly not with Internet Explorer 11. Additionally, we've found this problem to occur while running
RFT 8.6 with Mozilla Firefox 38.
After testing and reproducing this behavior in-house, we've found that to resolve the above issue, you can upgrade RFT to RFT 22.214.171.124 or the higher version.