public bool IsEnabled(string controlId)
{
bool retValue = false;
try
{
string disabled = _selObj.GetEval("selenium.browserbot.getCurrentWindow().getElementById('" + controlId + "').disabled");
retValue = disabled.ToLower() == "true" ? false : true;
if (retValue)
Log.Info(DateTime.Now.ToString() + " : Control " + controlId + " is enabled.");
else
Log.Info(DateTime.Now.ToString() + " : Control " + controlId + " is disabled.");
}
catch (Exception ex)
{
Log.Error(DateTime.Now.ToString() + " : Error occured while determining if control " + controlId + " is enabled");
throw new Exception("Error occured at SeleniumPage.IsEnabled on '" + controlId + "'", ex);
}
return retValue;
}
Recomended:Open Source Automation framework
Friday, June 26, 2009
Subscribe to:
Post Comments (Atom)
How is this called
ReplyDelete