How to find the type of the TestObject found using RFT find API
Richa@IBM 27000551BF Visits (6973)
Problem Description : I am using find API in RFT to get testobjects within an application. How can I figure out the type of the TestObject so that I typecast it to the appropriate TestObject in order to access the methods associated with the Test
Details : I explain the solution provided using this specific problem. In order to find checkbox in the application, find API can be efficiently used as below :
TestObject to = docu
else if no testobject map exists, we can do find on RootTestObject, as shown below:
RootTestObject rto = getR
TestObject to = rto.
By using the Html.INPUT.checkbox class, I have found the checkboxes in the application.
Now I need to know the appropriate TestObject to which I should typecast the found TestObjects. This can be done by finding the class of the testObject :
if(to != null)
Object testObjectClass = to[i].getClass();
ToggleGUITestObject tgi = (Tog
// Once the class is found and the TestObject is typecast to Togg
// There are three states which can be used as per the requirement : INDETERMINATE, SELECTED and NOT_SELECTED
The above explanation is about a checkbox. Similarly, it can be used for other testobjects. Typecasting the TestObject to an appropriate type gives access to the methods which are specific to the testobject.