Ex No 8 Loop Testing

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

EX NO : 8 LOOP TESTING

DATE :

TSL CODING:

#Open the data table in read write mode


ddt_open("C:\Documents and
Settings\skasc\Desktop\loop\loop\default.xls",DDT_MODE_READWRITE);

#Get the row count


ddt_get_row_count("C:\Documents and Settings\skasc\Desktop\loop\loop\default.xls",n);
for(i=1;i<=n;i++)
{
array[i-1]=ddt_val_by_row("C:\Documents and
Settings\skasc\Desktop\loop\loop\default.xls",i,"num");
}
kcount=0;
jcount=0;

//sorting
for(i=0;i<n;i++)
{
for(j=i+1;j<n;j++)
{
if(array[i]<array[j])
{
temp=array[i];
array[i]=array[j];
array[j]=temp;
}
kcount=kcount+1;
}
jcount=jcount+1;
}

// print the inner loop and outer loop execution count


tl_step("Loop Testing",0,"Inner Loop Count"&kcount);
tl_step("Loop Testing",0,"Outer Loop Count "&jcount);
tl_step("Loop Testing",0,"Successful");
TEST CASE – DATA TABLE IN EXCEL

TEST REPORT

You might also like