Hi,
We are working on automation of .Net based windows application developed using Infragistics TA WPF 2012.2.
We have a main window, from there by clicking on a button/label we are opening another window. This new window contains a XamDataGrid object; by using .Net Windows Forms spy we are able to see all properties and values like records count, visible records etc. But when we try retrieve the required native property values using QTP script, we are getting ‘object does not support this property’ for few properties. And while scripting QTP intellisense also not showing those properties like records count. What could be the reason for this issue?
One more issue is, we want to extract each cell background color in same XamDataGrid object. Is there any specific properties are available for this?
Could you please help us in resolving these issues.
Regards,
Ganesh
Hello Ganesh,
Thank you for your post. I have been looking into your questions and by default the QTP does not handle anything other than base value types.
I am not sure what exactly is the issue with the IntelliSense of the QTP but you could get the records count like:
WpfWindow("MainWindow").XamDataGrid("xamDataPresenter1").RecordCount
All the properties of the XamDataGrid you could find in the TetsAdvantage help:
C:\Program Files (x86)\Infragistics\TestAdvantage for WPF (HP) 2012.2\Help\ Infragistics.TAQTPWPF
Let me know, if you need any further assistance on this matter.
Hello Yanko,
Thanks for your reply.
My intention is not to extract record count, i have just used as an example. I am trying to retrieve background/foreground color of a cell inside XamDataGrid. Below is the hierarchy of object i have used to get the color.
WpfWindow("MainWindow").XamDataGrid("xamDataPresenter1").Object.ActiveCell.Record.DataPresenter.Background.Color.FromRgb
Above property is returning blank value. Please suggest any other methods/properties are available or any approach to get color?
Hi Ganesh,
Thank you for your feedback. I have been looking into your question and in order to get the RBG of specific cell you need to access its CellValuePresenter as Mike suggested in the following forum thread:
http://www.infragistics.com/community/forums/t/86570.aspx
You can access them like shown in the below snippet:
r = grid.GetSubItemProperty(gridCell, "{0}[Make]","FWElement.Background.Color.R")
g = grid.GetSubItemProperty(gridCell, "{0}[Make]", "FWElement.Background.Color.G")
b = grid.GetSubItemProperty(gridCell, "{0}[Make]", "FWElement.Background.Color.B")
Please not that this approach will be relevant, only if the target cells are visible(have initialized CellValuePresente).
Now we are able to extract backgroung color of cell using methods provided by you. Thank you very much :)
Thank you for your feedback. I am glad that you have managed to resolve your issue.