Gone2TheDogs
4 years agoOccasional Contributor
Desktop Scripting - How to throw an error
Hello! I'm brand new here! Love this tool but I must convince my company based on a proof of concept.
So, my simple question is, how do you throw an error based on your own test?
GridCellValue = Aliases.Purchasing.frmPurchasingMenu.MdiClient.frmPoShipDateMaint.pnlData.tabMain.tpgTracking.RadGroupBox5.dgvTracking.wValue(0,2) 'row, column
If GridCellValue <> "167 AAA Cooper" Then
'throw an error
End If
GridCellValue = Aliases.Purchasing.frmPurchasingMenu.MdiClient.frmPoShipDateMaint.pnlData.tabMain.tpgTracking.RadGroupBox5.dgvTracking.wValue(1,2) 'row, column
If GridCellValue <> "1234567890" Then
'throw an error
End If
2 ways :
- Javascript basis;
throw Error("This is the message of the error")
It will generate an exception and you can manage it in single endpoint with try .. catch pattern.
Note: you don't have to make throw new Error() because new is implicit.
- TestComplete basis (not really throwing error but sort of);
Log.Error("This is the message of the error")