2008-Nov-27 - How to kill the process of Application Under Test
To kill the process of application under test,
Assume, an test object (e.g. AnButton) is available, find and kill the process of application,
AnButton(ANY, NO_STATE).getTopParent().getProcess().kill();
|
|
Comments (0) :: Permanent Link
|
2008-Nov-9 - Call RFT Script play back in normal Java Application
Directly look into the codes below:
//Location of datastore(project), installDir and playback script
String datastore = "C:\\F\\Automation Workshop\\RFTWorkSpace\\Project1";
String installDir = "C:\\Program Files\\IBM\\Rational\\SDP\\6.0\\FunctionalTester\\eclipse\\plugins\\com.rational.test.ft.wswplugin_6.1.0";
String playback = "aa.Good";
if((new File(installDir)).exists())
{
FtInstallOptions.setInstallDir(installDir);
}
ScriptPlayback spb = new ScriptPlayback(playback);
spb.addArg("Any Arguments");
rational_ft_impl impl = new rational_ft_impl();
impl.initTheSession(datastore);
spb.run();
ScriptPlayback.closeMessageLog();
ScriptPlayback.closePlaybackMonitor();
TestContext.delete();
|
|
Comments (1) :: Permanent Link
|
2008-Oct-16 - Check box in Table?
RFT supports both HTML and JAVA application,
For HTML application:
GuiTestObject oCell1; TestObject[] arrButton1; ToggleGUITestObject oCheckBox1; oCell1 = (GuiTestObject)table_notification().getSubitem(atCell(atRow(1),atColumn(0))); arrButton1 = oCell1.getMappableChildren();
oCheckBox1 = (ToggleGUITestObject)arrButton1[0]; //assume there is only one check box in that cell
oCheckBox1.click(); //do click that check box
For Java application:
//Firstly, click the table at some cell table_notification().Click(atCell(atRow(1),atColumn(0))); //then, get mappable children test objects TestObject[] objs = table_notification().getMappableChildren(); //usually, the return list has only one object which is exactly the check box ToggleGUITestObject oCheckBox1 = (ToggleGUITestObject)objs [0]; //now get your checkbox; oCheckBox1.click();
|
|
Comments (0) :: Permanent Link
|
2008-Apr-15 - Markups for launch RFT scripts from Normal Java Class
It is only markup for my another entry named 'How to launch XDE Tester script in Command Line or Java main', i don't know why i can't edit it...:(
Before initiliaze the string array, a property of System needs adding like that:
System .setProperty( "rational_ft.install.dir", "C:\\Program Files\\IBM\\Rational\\SDP\\6.0\\FunctionalTester\\eclipse\\plugins\\com.rational.test.ft.wswplugin_6.1.0");
|
|
Comments (0) :: Permanent Link
|
2007-Dec-5 - ClassLoader in Rational Functional Tester
Sometimes, when we are using some third-party package e.g. log4j in our Rational Functional Tester project, we encounter some problems that the program can't found Class and throw out ClassNotFoundException.
In fact, Rational Functional Tester have its own ClassLoader named as FtClassLoader. In the scripts, the classloader returned by ***.class.getClassLoader() method is FtClassLoader. But the classloader returned by Thread.currentThread().getContextClassLoader() method is AppClassLoader which can't found attempted class.
Luckily FtClassLoader has a method addRelatedClassLoader, and it holds something like vector/array to holds all RelatedClassLoader. So i can add the AppClassLoader into FtClassLoader and set FtClassLoader as classloader of current thread, some codes like below:
FtClassLoader ftLoader = (FtClassLoader) ***.class.getClassLoader(); ftLoader.addRelatedClassLoader(Thread.currentThread().getContextClassLoader()); Thread.currentThread().setContextClassLoader(ftLoader);
|
|
Comments (0) :: Permanent Link
|
2007-Nov-12 - Utilize SpyMappedTestObject in Rational Functional Tester
While a test object is added into Object Map, RFT will generate a method named by the object defaultly. The return type of the method is GuiTestObject or its subclass. It is initialized by SpyMappedTestObject which could be returned by method 'getMappedTestObject'.
SpyMappedTestObject is very useful for us to extend the templates and strengthen RFT power. It supports a method called getProperty(String). The most helpful property is ROLE. This method could return role of test object e.g. CheckBox or Table or other kinds of UI component. The potential properties are:
#proxy
toolTipText
#name
#testobject
.class
#domain
accessibleContext.accessibleName
#id
iconDescription
#role
.classIndex
##parent
##nameInScript
|
|
Comments (0) :: Permanent Link
|
2007-Aug-29 - [RFT]getChildren & getMappableChildren
We could understand the difference of two method well from an example below;
Assuming there is a web page containing table, table is made of series of "A" link tags in each "TR" tag, and then "A" link holds each "TD" tag
its source code is something like:
| cell 1 | cell 2 |
| cell 3 | cell 4 |
| cell 5 | cell 6 |
RFT can capture the table as HTML.table, and can capture A tags as the HTML.A.
If you want to getTestData method to access each Cell, RFT can't read the cells in the table because the A tags break the standard structure.
So firstly, i can use getMappableChildren to get the list of A tags. In for loop, i can use getChildren of A tag to get the list of cells in the row. (Notice, here getMappableChildren doesn't work, because TD tag is not a mappable tag) Now, i can control each cell e.g. click, getProperty, getTestData...
Oh,,, never forgot to unregister those testobjects :-)
|
|
Comments (0) :: Permanent Link
|
2007-Jul-29 - Iterator specified Datapool in RFT
Here is code:
//getOption(IOptionName.DATASTORE) returns the path of current project
File file = new File((String) getOption(IOptionName.DATASTORE),"MyDatapool.rftdp");
//load datapool as share one
IDatapool datapool = dpFactory().load(file, true);
IDatapoolIterator iterator = dpFactory().open(datapool, null);
//iterator must be initialized, if not, all parameters are null in the initialize
iterator.dpInitialize(datapool);
//using while loop to iterator the datapool
while (!iterator.dpDone()) { String value = iterator.dpString("Name");
//next iterator.dpNext(); }
|
|
Comments (0) :: Permanent Link
|
2007-Jul-29 - Edit Datapool in Rational Functional Test
About Datapool, RFT define two series of interface: edit and runtime, so you may find many same interface in package "org.eclipse.hyades.edit.datapool" and "org.eclipse.hyades.execute.runtime.datapool". There are the same interfaces IDataFactory, IDatapool, IDatapoolEquivalenceClass, IDatapoolRecord etc...
And all the ones in org.eclipse.hyades.edit.datapool extends the ones in org.eclipse.hyades.execute.runtime.datapool
i want to edit Datapool and save after the scripts are executed, so i used the series of interface under "org.eclipse.hyades.edit.datapool" package.
In implement of RFT about Datapool, every datapool contains a list of IDatapoolVariable and a list of IDatapoolEquivalenceClass. As i know, the list of IDatapoolEquivalenceClass always contains only one element. And the only element holds the list of IDatapoolRecord. Each IDatapoolRecord has a list of IDatapoolCell. i could access any IDatapoolCell by index or variable string. And when you get some IDatapoolCell out, you could edit it by setCellValue and save the datapool.
Here you must use the series of edit.
Here are codes:
//DatapoolFactory uses singleton design pattern
DatapoolFactory factory = DatapoolFactory.get();
//Load a datapool, true means the datapool is shared
IDatapool editPool = factory.loadForEdit(new file("DATAPOOL FILE PATH"), true);
//Get Equivalence Class by index, since there are only one equivalence class
IDatapoolEquivalenceClass eClazz = (IDatapoolEquivalenceClass)editPool.getEquivalenceClass(0);
//Use loop to access every record in the datapool
for (int i = 0; i < eClazz.getRecordCount(); i++) { IDatapoolRecord record = (IDatapoolRecord) eClazz.getRecord(i); IDatapoolCell cell = (IDatapoolCell) record.getCell("VARIABLE NAME"); cell.setCellValue("MY DATA"); }
|
|
Comments (0) :: Permanent Link
|
2007-Jun-1 - How to launch XDE Tester script in Command Line or Java main
Lauch XDE Tester script in Command Line:
Below is an example of a bat file
set INSTALLDIR="c:\Program Files\Rational\XDETester\eclipse\plugins\com.rational.test.ft.wswplugin_2.0.0" set MYPATH="c:\Program Files\Rational\XDETester\eclipse\plugins\com.rational.test.ft.wswplugin_2.0.0\rational_ft.jar;c:\Program Files\Rational\XDETester\eclipse\plugins\com.rational.test.ft.wswplugin_2.0.0\xerces.jar" set DATASTORES="C:\E\XDEWorkSpace\GLOMSSmokeTest"
java -Drational_ft.install.dir=%INSTALLDIR% -classpath %MYPATH% com.rational.test.ft.rational_ft -datastore %DATASTORES% -playback HelloWorld -logfolder "Default" -log "Al_SimpleClassicsA#1"
Notice, you must set the XDE log as html or none or text before to lauch the XDE Tester script, configured using:
Window->Preferences->Rational XDE Tester->Logging: Log Type
Below is example to lauch XDE Tester script in Java main:
public class TestMain {
public static void main(String[] args) {
String[] str =
{
"-datastore",
"C:\\E\\XDEWorkSpace\\GLOMSSmokeTest",
"-playback",
"HelloWorld",
"-logfolder",
"Default",
"-log",
"Al_SimpleClassicsA#1" };
rational_ft.main(str);
System.out.println( "I'm a good boy!"); //Notice, this line would never be executed.
}
}
|
|
Comments (0) :: Permanent Link
|
2007-Jun-1 - Edit VP on runtime
Assume you have Verification Point in XDE Tester Script Explorer named "table_contents"
//Every Verification Point Ojbect has Verfication Point Data, you could retrieve it as below:
IFtVerificationPoint vp = (IFtVerificationPoint) table_contentsVP(); //get Verification Point Ojbect //get Verfication Point Data
IFtVerificationPointData data = (IFtVerificationPointData) vp.getBaselineData();
//Every VP data has an list of TestObjectDescriptor, you could use findFirst method to get the first one.
ITestObjectDescriptor des = data.findFirst();
//Because of the VP is actually is table VP, so VP data could genertae an ITestObjectTable's instance.
ITestDataTable td = (ITestDataTable) data.getData(des);
//then we could operate the TestDataTable, which has Data and Region to modify
//to modify Data:
td.setCell(0, 1, "string"); //to change string value of "String" at cell(0,1)
//the region of VP, which means what cells need to compare
// to get the resgions which is a set of compare regions.
TestDataTableRegions regions =(TestDataTableRegions) td.getProperty( "compareRegions");
TestDataTableRegion rg = regions.getRegion(0); //to get the first region
regions .removeAllRegions(); //remove the region
//create a region (the cell at first row, 3rd column)
ITestDataTableRegion r =TestDataTableRegion.oneCell(atCell( new Column(2), new Row(0)));
ITestDataTableRegion[] rlist = { r }; //generate regions
regions.setRegions(rlist); //set regions
data.setData(des, td); //reset the VP data
vp.performTest(); //perform the VP
|
|
Comments (0) :: Permanent Link
|
2006-Nov-25 - What is software
Software - IEEE definition
Software is:
Computer programs, procedures, and possibly associated documentation and data pertaining to the operation of a computer system.
- Computer programs (the "code") are needed because, obviously, they activate the computer to perform the required application.
- Procedures are required, to define the order and schedule in which the programs are performed, the method employed, and the person responsible for performing the activities that are necessary for applying the software.
- Various types of documentation are needed for developers, users and maintenance personnel. The development documentation (the requirements report, design reports, program descriptions, etc.) allows efficient coorperation and coordination among development team members and efficient reviews and inspections of the design and programming products. The user's documentation (the "user's manual", etc.) provides a description of the available applications and the appropriate method for their use. The maintenance documentation (the "programmer's software manual", etc.) provides the maintenance team with all the required information about the code, the structure and tasks of each software module. This information is used when trying to locate causes of software failures ("bugs") or to change or add to existing software.
- Data including parameters, codes and name lists that adapt the software to the needs of specific user are necessary for operating the software. Another type of essential data is the standard test data, used to ascertain that no undesirable changes in the code or software data have occured, and what kind software malfunctioning can be expected.
|
|
Comments (0) :: Permanent Link
|
2006-Nov-21 - How to get the focus window with XDE Tester
//the scripts below can be used to get the focus window:
IWindow win = RationalTestScript.getScreen().getActiveWindow();
//and you can use the code to find the focus window's name, and to close the window
String caption = win.getText();
win.close();
//then you can write a while hoop to identify whether the focus window is the expected one
//if not, close it. thus you can do error clean while a Fail turns up
while(ture){
IWindow win = RationalTestScript.getScreen().getActiveWindow();
if (win.getText().equals("InitScreenName"))
break;
else
win.close();
}
|
|
Comments (0) :: Permanent Link
|
2006-Nov-21 - Seven issues characterize the professional software development and maintenance environment
- Contractural conditions
- A defined list of functional requirements that the developed software and its maintenance need to fulfill
- The project budget
- The project timetable
- Subjection to customer-supplier relationship
- Required teamwork
- Cooperation and coordination with other software teams
- Interfaces with other software systems
- The need to continue carrying out a project despite team member changes
- The need to continue carrying out software maintenance for an extended period
|
|
Comments (0) :: Permanent Link
|
2006-Nov-21 - Three major differences between software products and other industrial products
-
Complexity
-
Software products: Usually, very complex prduct allowing for every large number of operational options
-
Other industrial products: Degree of complexity much lower, allowing at most a few thousand operational options.
-
Visibility of product
-
Software products: Invisible product, impossible to detect defects or omissions by sight.
-
Other industrial products: Visible product, allowing effective detection of defects by sight.
-
Nature of development and production process
-
Software products: Opportunities to detect defects arise in only one phase, namely product development.
-
Other industrial products: Opportunities to detect defects arise in all phases of development and production:
|
|
Comments (0) :: Permanent Link
|
|
About Me
belive, and check
Calendar
« January 2009 »
| Mon | Tue | Wed | Thu | Fri | Sat | Sun | | | 1 | 2 | 3 | 4 |
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| 26 | 27 | 28 | 29 | 30 | 31 | |
Friends
|