IBM RFT Interview Questions: Q. 131 to 140
Q. 131: How do we search for various “TestObjects” using RFT?
In RFT we can locate a TestObject programmatically.
Here our search for the TestObject is based on name and value pairs representing the properties of the concerned TestObject or TestObjects. Our search can be either global or limited to children of a parent TestObject.
RFT uses an object called the “RootTestObject” to represent a global view of the software under test in the following ways.
1) For searching the entire application, we can use the find method on the RootTestObject.
2) For searching a specific object, we can use find on that TestObject. Searching a specific TestObject will search only the children of that TestObject.
<<<<<< =================== >>>>>>
Q.132: What are the benefits of having helper superclasses in RFT?Helper superclasses provide following advantages
1) Helper classes allow us to add functionality to our test scripts.
2) Helper superclasses are quite helpful in sharing the functionality across multiple scripts.
3) A super helper provides a single place for us to park our code which wewish that every script should access. Any piece of code placed there will be inherited by every helper class that extends the super helper.
<<<<<< =================== >>>>>>
Q. 133: What type of events are recorded by RFT in its log file during playback of the script?
RFT automatically logs the following events in the log file:
1) Script start
2) Script end
3) Calls to the callScript method
4) Calls to the startApplicaction method
5) Timer start
6) Timer end
7) Exceptions
8) Verification points
<<<<<< =================== >>>>>>
Q. 134: What methods are used for including our own custom messages in the RFT Log File?
1) For including our own General Messages : We can use the “logInfo” method.
2) You logging a Test Result : We can use the “logTestResult” method.
3) For writing an Error Message: We can use the “logError” method.
4) For adding a Warning Message: We can use the “logWarning” method.
<<<<<< =================== >>>>>>
Q. 135: How do we capture the current value of an option specified for the script?
Value of an option set programmatically lasts until the end of the playback only.
After the playback finishes, the option reverts back to the default value.
To capture the current value of an option, we can use the “getOption” method like the following:
Object x = getOption(IOptionName.option);
Value of “x” can be tested to find out whether we want to change the option value during the playback. We can use the “setOption” method using the forma liket:
setOption(IOptionName.option,value);
<<<<<< =================== >>>>>>
Q. 136: What is the method to reset the value of an option back to the default value in a script?
“resetOption” method can be used to reset the value of an option back to its default value.
As an example, we can write a a code in the following sequence to change the delay between keystrokes during the playback for a short time :
setOption(IOptionName.DELAY_BEFORE_KEY_DOWN, 0.3);
InputWindow().inputKeys(“abcdefg123”);
resetOption(IOptionName.DELAY_BEFORE_KEY_DOWN);
InputWindow().inputKeys(“999”);
<<<<<< =================== >>>>>>
Q. 137: How do we start a RFT script from within a script?
We can create a RFT script which can serve as a command file for a suite of scripts.
We can use the “callScript method” for invoking other test scripts.
<<<<<< =================== >>>>>>
Q. 138: What is EclipseScript?
It is asample superscript package code which can be used in our own scripts. It provides few methods which are useful when testing plugins running inside the Eclipse platform.
These sample codes use the internal Eclipse classes. These must be used with prior knowledge that these may break with future versions of eclipse.
<<<<<< =================== >>>>>>
Q. 139: How do we search TestObjects using some search criteria in RFT?
In RFT we can use our own specified search criteria for locating the various “TestObjects”.
RFT executes the search based on name / value pairs representing properties of the “TestObjects” being searched. This search can either be a global search or it can be limited to the children of some parent “TestObject”.
a) For Global Search : We use the find method on the “RootTestObject”; since “RootTestObject” covers a global view of the software under test.
b) For Limited Search : We use “TestObject” find method which would search the children of a particular “TestObject”.
<<<<<< =================== >>>>>>
Q. 140: How do we search SAP TestObjects without using the Object Map?
In RFT we can use our own specified search criteria for locating the various “TestObjects”.
RFT uses a “RootTestObject” to represent a global view of the software under test.
We can use the “enableForTesting” method on the “RootTestObject” to enable the SAP application for testing. For performing a global search on SAP applications we can use the find method on the “RootTestObject”.
Continue to Next Part : Q 141 to 150
An expert on R&D, Online Training and Publishing. He is M.Tech. (Honours) and is a part of the STG team since inception.