//First I verify whether the field eixsits, if NOT ONLY, I will wait for 10 seconds.
while(selenium.isElementPresent(fieldname)!=true) {
try {
Thread.sleep(10);
vcounter=vcounter+10;
//this code should be modifed, otherwise won't work
/* String vexist=selenium.isElementPresent(fieldname)
if (vexist)
break;
*/
if ((vcounter>=70) & (selenium.isElementPresent(fieldname)!=true))
{
String faildescription = "Field does not exist on this page.";
GenericFunctions gf= new GenericFunctions();
gf.writePOI(failflag,pagename,far[1],far[0],excelrc,"c:\\resultsall.xls",faildescription);
gf=null;
AllVariables.exitTest=true;
break;
}
}
catch (Exception e)
{}
} // while loop
}
catch(Exception e)
{System.out.println(e.toString());}
return selenium.isElementPresent(fieldname);
}