Handling exceptions
If an exception occurs during testing, you might be able to handle it by following these instructions. Two common exceptions are the ambiguous recognition exception and the Mutex timeout exception during playback.
Ambiguous recognition exception
Problem
In certain cases during playback, for example, when multiple instances of a browser are running, Rational® Functional Tester might be unable to differentiate between two similar objects in the software that is being tested. At such times, an AmbiguousRecognition exception occurs. For example, this problem might occur when multiple instances of a browser are running.
Resolution
- Find the duplicate instance of the application, close the instance, and click Retry.
- Add a unique property to the object in the test object map to distinguish the ambiguous objects.
- Open the test object map from the Script Explorer.
- Find the object that the ambiguous exception was thrown for, right-click the object, and highlight it. This action highlights the objects that Rational® Functional Tester finds similar.
- Identify a unique property among these objects and use the find() API,
passing the unique property to find the method, and then do the required
operation. For example, to click a button that is named Back, use
this approach:
TestObject [] backBtn = find(atDescendant(".class", ".PushButton", ".text", "Back")); if( backBtn.length == 1){ ((GuiTestObject)backBtn[0]).click(); } else{ //Add code to log message that more than one instance of object is still found }
Mutex timeout exception during playback
Problem
During the playback of functional test scripts, this Mutex timeout exception might occur:com.rational.test.ft.svs.Mutex$TimeoutException .
Resolution
- Click Start and then click Run. Type regedit. The Windows Registry Editor opens.
- Navigate to the [HKEY_LOCAL_MACHINE\SOFTWARE\Rational Software\Rational Test\8] registry key.
- Create a new DWORD value named SpyHeapSize and set its value data to 2097152 (or 200000 hexadecimal)
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Rational Software\Rational Test\8]
"SpyHeapSize"=dword:00200000