Hi,
I'm evaluating the HP QTP addin TestAdvantage for WPF (10.3), and while testing out the addin, QTP is able to recognize the XamDataGrid "Great!", but I've noticed that the addin has difficulties in recognizing embedded controls inside of a XamDataGrid, such as WPF ComboBoxes and Buttons.
When I go and unload the addin, and use QTP to spy on the objects, of course the XamDataGrid is now recognized as a generic WpfObject, but now at the very least QTP is able to locate the embedded controls (WpfComboBox, WpfButton).
Is there a way, with the addin loaded, to detect what embedded control type is inside the gridCell, and get its properties?
I've tried this:
WpfWindow("My Application").XamDataGrid("xamDataGrid1").GetSubItemProperties(gridCell, "{0}{1}[ColName]", "CellValuePresenter.Children.Count")
and it returns a value of 1. But it doesn't seem I can see exactly what type of child it is.
Thanks!
Thanks for adding your suggestion. I'm sure it will be helpful to others.
Please let me know if there is anything more I can do to help you.
Yeah the suggestions that were offered didn't solve the problem, I dug around online and finally went the path of using Microsoft's UIAutomation api to look for the WPF controls and performed the actions. It's a little much, but it's a workaround.
I hadn't heard back from you and am wondering if you have any questions.
Please let me know if there is anything more I can help you with.
I believe Petar is correct; there doesn’t seem to be a way to turn the add-in on and off from with QTP script.
Looking at the sample that Petar provided you can also use the GetCellData and SetCellData with references like in this snippet.
strCellValue = WpfWindow("MainWindow").XamDataGrid("XamDataGrid1").GetCellData( "{2}[LastName]")
msgbox strCellValue
Hope this helps.
Hi Marianne,
I appreciate the help, I had opened a support case (CAS-112897-Z7Y6G6) for this last week and it seems that the support engineer and I had no luck in coming up with a solution. But if you can find anything that would be great. Were using a slightly older version of NetAdvantage for WPF 2010.3 and TestAdvantage for WPF 2010.3
Thanks,
Long