sarya
15 years agoFrequent Contributor
How to find the status of checkboxes on webpage window
Hi,
I am trying to verify the status of the checkboxes marked under options R,C,F as seen in screenshot . I am able to click on that with this code but somehow the status verification is not working. I tried CellObj.status and CellObj.checked but for both of them it is not able to find status and chekced property.What can I use to verify the checkbox status whether it is checked or not. Checbox enables property will not work as the checkbox under C and F are always enabled,i need to check whether they are checked or unchecked.
{
page3 = iexplore.Page("http://" + servername + ":" + port + "/" + r2wcontext + "/user.do*");
document = page3.document;
page3.NativeWebObject.Find("title","UserRead","A").Click();
all2 = document.all;
var cellText = "/UserRead";
var cellObj = GetNextCell(all2, cellText);
if (cellObj.status == "False") //This is not working.
Log.Message("The content access for member is saved correctly","",pmNormal,Attr);
else
Log.Error("There is some error","",pmNormal,Attr);
}
GetNextCell(allObj, cellText){ obj = allObj.FindChild("outerText", cellText); nativeCell = obj.parentNode.cells.item(2); allObj.FindChild("uniqueID", nativeCell.uniqueID);}Thanks.
I am trying to verify the status of the checkboxes marked under options R,C,F as seen in screenshot . I am able to click on that with this code but somehow the status verification is not working. I tried CellObj.status and CellObj.checked but for both of them it is not able to find status and chekced property.What can I use to verify the checkbox status whether it is checked or not. Checbox enables property will not work as the checkbox under C and F are always enabled,i need to check whether they are checked or unchecked.
{
page3 = iexplore.Page("http://" + servername + ":" + port + "/" + r2wcontext + "/user.do*");
document = page3.document;
page3.NativeWebObject.Find("title","UserRead","A").Click();
all2 = document.all;
var cellText = "/UserRead";
var cellObj = GetNextCell(all2, cellText);
if (cellObj.status == "False") //This is not working.
Log.Message("The content access for member is saved correctly","",pmNormal,Attr);
else
Log.Error("There is some error","",pmNormal,Attr);
}
function GetNextCell(allObj, cellText)
{
var obj = allObj.FindChild("outerText", cellText);
var nativeCell = obj.parentNode.cells.item(2);
return allObj.FindChild("uniqueID", nativeCell.uniqueID);
}
Thanks.
GetNextCell(allObj, cellText){ obj = allObj.FindChild("outerText", cellText); nativeCell = obj.parentNode.cells.item(2); allObj.FindChild("uniqueID", nativeCell.uniqueID);}Thanks.