aqObject.CheckProperty- (checkpoint on Content text) Control does not go to else condition
Hi,
Is there anything wrong with below code? Control is not going to Else conditon even if the If condition is not true. It just evalutes If condition and throws an error.
Note: Object properties for both are same only the "content text" differs.
if((aqObject.CheckProperty(Aliases.browser2.pageFos2.formPlaceorder.tableOrderlist.cellColumn4, "contentText", cmpEqual, "Order accepted"))==true){
Log.Message("Order Accepted")
}
else{
if(aqObject.CheckProperty(Aliases.browser2.pageFos2.formPlaceorder.tableOrderlist.cellColumn4, "contentText", cmpEqual, "A pending order already exists.")==true){
//Code goes here
}
}
I'd Expect so, yes.
A cleaner way of comparing though would probably be
var doesCompare = aqstring.Compare(Aliases.browser2.pageFos2.formPlaceorder.tableOrderlist.cellColumn4.contentText,"Order Placed",false);
if(deosCompare==0)
{
...
}
else
{
...
}since contentText is a property of a TC object.
When you are doing the check, are you sure the contentText has changed e.g. what does Log(Aliases.browser2.pageFos2.formPlaceorder.tableOrderlist.cellColumn4.contentText) tell you at each step of the process ?
If it' not what you see on the screen, you may be able to Refresh mapping info