| || |
I'm getting an ambiguous recognition error (RFT is detecting 2 instances of the same object) on an htmlBrowser object when there is clearly only one browser open (this is apparent even in the error screenshot). Does anyone know what might be going on?
Re: Ambiguous recognition
do a simple search for "ambiguous recognition" in help or else, click on the browser when the app is open and add the contents in parens to the browser object you are searching for.
Re: Ambiguous recognition
This is what I found in Rational Functional Help.
Handling Ambiguous Recognition
In some situations during playback, Functional Test might not be able to differentiate between two like objects in the software under test. For example, in HTML applications when more than one instance of a browser is active, recognizing one browser from another on toolbar actions would be impossible if they were recorded like these examples:
In cases like this, Functional Test avoids ambiguous recognition by locating the toolbar button in the browser that is identified by its currently loaded document (referred to as an anchor for the target object). For example:
The toolbar back button is anchored by the browser, which is anchored by the document "My HomePage". This example would not work, of course, if each instance of the browser has the same loaded document. Note that the helper script methods that take an anchor as an argument also require another argument that specifies the component's state (the DEFAULT argument in the example above). The default state for HTML objects is LOADED. For HTML components LOADING and UNINITIATED are also possible. The default state for Java objects is SHOWING and ENABLED. Other supported state flags for Java objects are NOT_SHOWING and DISABLED.
In addition, you can identify the browser instance by using a TestObject reference for it, invoking the find method on the browser as follows (remember to unregister the TestObject when you are done).:
TestObject browserOne = Browser_htmlBrowser(Document_MyHomePage(),
The browser toolbar commands in the test script would look like this example:
Another situation where ambiguous recognition can be an issue is when a test has more than one application running at the same time. During playback, commands like b5().click() are ambiguous. Because the startApp command returns a ProcessTestObject, this reference can be used to specify which application a particular command applies to. For example:
ProcessTestObject p1 = startApp("SwingTest");
ProcessTestObject p2 = startApp("TryIt");
//b5().click(); ambiguous on playback; which application?
In the last line of the example, the ProcessTestObject functions as an anchor to locate the desired application. Note that calling the unregister method for a ProcessTestObject is unnecessary.
(C) Copyright IBM Corporation 2002, 2004. All Rights Reserved.