msap
7 years agoFrequent Contributor
If else statement issue
Hi
inserted below code , it does not move to else statement in case of the object does not exists. Gives an error messageform3 any suggestions pls
if (MessageBoxForm3.Exists){
MessageBoxForm3.SimpleButton.ClickButton();
ExcelImportForm.Close();
Log.Message("Import is successful")
}
else
if (MessageBoxForm4.Exists)
{ MessageBoxForm4.SimpleButton.ClickButton();
ExcelImportForm.Close();
MessageBoxForm7.SimpleButton.ClickButton();
Log.Error("Import fails");
}
ClickItem("Refresh");
}