.Exists Property
I am trying to use the Exists property to see if a cell is showing on a web page. I assign what the cell FullName should be to a variable and then use an If statement to see if it exists. I'm very new to SmartBear and programming (work term student). I also tried using the "Name" of the cell but another cell already has the same name. The issue is that I keep getting the error that the Cell does not exist. i know it doesn't exist at a certain point and I have a While loop that takes that in to account and should move on to another step. Here is my code. Any help is appreciated. Thanks
//USEUNIT library
//Test Author:
//Description: Verify that x, y or z happens
//Task Coverage: List any tasks known to be covered by test
//TO DO: 1. the veryify text that makes sure the right record is populated on the main
//page only works for a specific record. I need to make it so it can be used for
//whatever record is chosen
//2.
function lookup_and_display_order_task() {
try{
//Create variables
var contentText,cellObj,expectedValue,foundObject,cellAvailable,infoMissing;
var i = 1;
//Open program
FastPath("RWOS028");
//Search by Order/Tsk
Click("Lookup");
Click ("Enter");
WaitForPage();
//cellObj = Sys.Browser("iexplore").Page("http://develq.pathix.com/Devel_Q/Pathix.InqWO_2_View/DINQ004.aspx").Form("Form1").Panel("XXX").Panel("BILD01C").Table("igtabuwtBILD01S").Cell(1, 0).Panel("uwtBILD01S_div0").Panel("wdgBild01S").Panel(0).Table("outerTbl_hdn").Cell(1, 0).Table("contentTbl").Cell(1, 0).Panel("container").Table("dataTbl_hdn").Cell(7, 0);
//expectedValue = cellObj.contentText;
ClickTableCell(1,0);
//Make sure Work Order is populated on Order Tsk Cost Inquiry page
Click("Exit");
//VerifyText("BILD02C_D1ORNO",expectedValue);
Click ("Enter");
WaitForPage();
infoMissing = Sys.Browser("iexplore").Page("http://develq.pathix.com/Devel_Q/Pathix.InqOrderCost_View/DWOS028.aspx").Form("Form1").Panel("XXX").Panel("ERRCTL").Panel("ERRSFL").Panel("ERRSFL_0").TextNode("ERRSFL_MSGKEY_0");
//While loop that continues selecting Order/Tasks until it finds one with
//a Work Order
while (infoMissing.Exists){
cellAvailable = Sys.Browser("iexplore").Page("http://develq.pathix.com/Devel_Q/Pathix.InqOrderCost_View/DWOS028.aspx").Form("Form1").Panel("XXX").Panel("BILD02C").Panel("ordTskGrid").Panel("wdgOrdTskCstInq").Table("outerTbl_hdn").Cell(0, 0).Table("contentTbl").Cell(1, 0).Panel("container").Table("dataTbl_hdn").Cell(0, 0);
if (! cellAvailable.Exists){
i++
Click("Lookup");
Click ("Enter");
ClickTableCell(i,0);
//Check to see if Work Order is populated on Order Tsk Cost Inquiry page
Click("Exit");
Click ("Enter");
WaitForPage();
} else {
ClickTableCell(0,0);
Click("Enter");
Click("UltraWebTab1td1");
Click("UltraWebTab1td2");
}
}
}
catch (e) {
RunTimeError(e);
}
}
function test(){
LocateObject("Cell(1,0)");
}