QTP version 10 has a GetErrorProviderText method that is supposed to retrieve the error symbol from an object in an error dialog and is used as follows:
msgbox SwfWindow("Net sample app").SwfEdit("txtBox1").GetErrorProviderText
My question is how can I use this in an Infragistics grid to capture the same error symbol (Red exclamation point)? How do I tell the method where to look for the error symbol?
Hello,
For getting the error information that is displayed within the WinGrid, you will need to use an alternate approach and this will require knowledge of what data source the WinGrid is bound to as you will need to get the error from list objects in the data source.
If you can find from your developers which properties on the data item expose the error information, then you can use the GetNAProperty method to get the error information like the following example:
SwfTable("Grid1").GetNAProperty("Rows[0].ListObject.Error")
This would return the error for the row. Note this will work for custom objects that implement IDataErrorInfo, if you are bound to a DataTable, then the ListObject is the DataRowView and you would need to pass in "Rows[0].ListObject.Row.Error" to the GetNAProperty method.
Let me know if you have any questions with this matter.
Alan