Post

1 Star2 Stars3 Stars4 Stars5 Stars
Loading ... Loading ...

By Rafaela Azevedo
Hello again,
I had this new thing that I have learned and use almost every days.
You can use this when you need return many values of some table.This code will return a list of things with a column and theirs line. So, here go the code:
Hashtable valores = new Hashtable();
int qtdLinesTblSimAcu = 0;
if(tableSimPresent)
{
String[] cTabelSim = new String[10];
cTabelSim[1] = “ID”;
cTabelSim[2] = “Buyer.Firm”;
cTabelSim[3] = “Buyer.Account”;
cTabelSim[4] = “Buyer.Qty”;
cTabelSim[5] = “Seller.Firm”;
cTabelSim[6] = “Seller.Account”;
cTabelSim[7] = “Seller.Qty”;
cTabelSim[8] = “Price”;
cTabelSim[9] = “Traded.Qty”;
//LET CATCH ALL THE LINES AND PUT IN HASHTABLE
int qtdLinhasTblSim = (Integer) selenium.getXpathCount(//html/tbody/table/tr“)); // CHANGE FOR THE CORRECT XPATH ONLY UNTIL THE TR TAG.
qtdLinesTblSimAcu += qtdLinesTblSim;
if(qtdLinesTblSim > 0)
{
//NAVIGATE FOR LINES AND COLUMNS
for(int l = 2; l

Source: http://azevedorafaela.wordpress.com/2013/05/26/using-hashtable-for-include-many-values-in-an-array-webdriver-java/

Category: Programming, QA, Test and Automation Stuffs, hashtable, return of table, values in a list

Você também pode querer ler

Comments are off for this post.