import resources.parse_table_idHelper;
import com.rational.test.ft.*;
import com.rational.test.ft.object.interfaces.*;
import com.rational.test.ft.object.interfaces.SAP.*;
import com.rational.test.ft.object.interfaces.siebel.*;
import com.rational.test.ft.script.*;
import com.rational.test.ft.value.*;
import com.rational.test.ft.vp.*;
public class parse_table_id extends parse_table_idHelper
{
public void testMain(Object[] args)
{
try {
//Search for html table
TestObject[] foundTables = RationalTestScript.find(
atDescendant(".class", "Html.TABLE", ".id", "my_table"));
if (foundTables.length != 1) throw new Exception("Table not found");
StatelessGuiSubitemTestObject html_table = (StatelessGuiSubitemTestObject)foundTables[0];
// table parsing
ITestDataTable table = (ITestDataTable)html_table.getTestData("contents");
int nbRows = table.getRowCount();
int nbCols = table.getColumnCount();
for (int i=0; i<nbRows; i++) {
for (int j=0; j<nbCols; j++) {
if (table.getCell(i, j) != null) {
TestObject cell = (TestObject)html_table.getSubitem(
atCell(atRow(i), atColumn(j)));
String cellID = (String)cell.getProperty(".id");
if (! cellID.equals("")) {
System.out.println("Cell (" + (int)(i+1) + "," + (int)(j+1) + ") ID : " + cellID);
}
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
Hello, This will help to call RFT scripts in xml, if anyone using 'ant' this will help them to embed code to invoke RFT scripts. <java classname="com.rational.test.ft.rational_ft" fork="true" maxmemory="1024m"> <classpath> <fileset dir="C:\Program Files\IBM\SDP\FunctionalTester\bin\"> <include name="rational_ft.jar" /> </fileset> </classpath> <jvmarg line="-Drational_ft.install.dir="C:\Program Files\IBM\SDP\jdk_\jre\bin"" /> <arg line="-rt.bring_up_logviewer false -datastore "D:\RFT-Dev\Project" -playback RFTTestSet5.testcase4.TestScript1" /> <arg line="-args -scriptArg ${scriptValue}" /> ...
How to know ".id" property of an HTML Table. I am not able to find any other property except ".class" of HTML Table.
ReplyDelete