Hi,
We are using Infragistics Test Advantage addon for WPF - version 2013.2 with UFT 12.02(patch2). I have .NET add in installed.
AUT is developed using: Infragistics Net advantage:2013 version 2
We have an XAM Data Grid where in one column, 3 WPF buttons are embeded in CellValue presenter (Infragistics.Windows.DataPresenter.CellValuePresenter)
From snoop, i am able to identify a stack panel, where it shows the children count as 7 out of which only 3 are currently visible.
StackPanel.Children (System.Windows.Controls.UIElementCollection)
How to access the properties of this stack panel.
StackPanel.Children[1].isVisible - shows true/false depending upon the visibility of buttons
Am able to access the CellValuepresenter using GetSubitemproperty method. but unable to find a way to access this children stack panel. Please guide
Attached the screenshot for reference.
Thanks,
Dhivya.D
Hi Dhivya,
I would use snoop to verify the exact position in the child elements under the control. But you should be able to use the TA CustomProperties FWElement, ContentElement, Children to dig through to the StackPanel and get access to the properties that you are looking for. The installed help gives an example of it at Working with WPF TestAutomation for HP > Accessing Controls' Properties > GetSubItemProperty. I also go into detail about this further in a Webinar located on youtube here: https://www.youtube.com/watch?v=j-_dQHVSt2U. In general you might want to watch from 18:07, but more specifically going into how to use snoop to in conjunction with testing at what you are looking for at 44:20.
Let me know if that helps,
Thanks for the suggestion. The video was very helpful.
I am able to dig through the child elements and identify the buttons and their properties.
set grid=WpfWindow("Home").XamDataGrid("Grid")intButCount=grid.GetSubItemProperty(gridCell,"{0}[0]","FWElement.Children[0].Children[3].Children[0].Children[0].ChildCount)
for j=0 to intButCount-1strActualButtonName=grid.GetSubItemProperty(gridCell,"{0}[0]","FWElement.Children[0].Children[3].Children[0].Children[0].Children["&j&"].Name") blnEnable=grid.GetSubItemProperty(gridCell,"{0}[0]","FWElement.Children[0].Children[3].Children[0].Children[0].Children["&j&"].IsEnabled") msgbox strActualButtonName & "--" & blnEnablenext
I have taken the child elements of the parent node (Contentvalue presenter) and its children (and inturn its children) to identify the stack panel.
From the snoop, object hierachy of the object is identified as:
<<Cellvaluepresenter>>.<<DockPanel>.<<Content Control -3rd child>>.<<ContentPresenter>>.<<Stack Panel>>ie: FWElement.Children[0].Children[3].Children[0].Children[0]
If there is a change in this object hierarchy then the above object identification will fail.
Instead, do we have any option to identify the child elements with some unique identification properties, for ex:I have to identify the content presenter inside FWElement??
Is there any other way to over come this issue??
Please suggest.
Thanks,Dhivya.D
Hi Joseph,
Not sure why you are getting that error. Can you let me know a couple things:
What is the full version of IG TestAutomation add in that you have installed. IE 15.2.20152.1000
msgbox wpfwindow("window").XamDataGrid("grid").GetSubItemProperty( gridCell,"{1}[File Number]", "FWElement.Type.Name" )msgbox wpfwindow("window").XamDataGrid("grid").GetSubItemProperties( gridCell,"{1}[File Number]", "FWElement" )
Essentially with the version, I want to test the specific version to make sure no new error creeped in. Although I highly doubt it.Second one, to see if perhaps if there was a custom type being used that may be changing the behavior.And lastly which is kind of an extension of the first, but if your developer perhaps added a property for Children to the FrameworkElement, that may be confusing the TACustomProperty Children. Kind of a stretch but could be an explanation.
I got WPF Test automation for HP 2014 vol. 2 (IDK where to find the full version number) from this link: http://www.infragistics.com/support/archived-downloads
assuming you wanted me to post the output of those two statements you gave me:
the first message box returns: CellValuePresenter
this is some of the output from the second statement:
Children|System.Windows.DependencyObject[]|TA CustomPropertyChildCount|System.Int32|TA CustomProperty
I'll take it the fact that the Children property there is the problem?.. I'll speak with the devs about it when I get the chance
Actually the TA CustomProperty is correct. It is what should show up, as it is an injected property that we added for TA customers. I was primarly asking if it showed Children as a non custom property. But actually the 14.2 though is likely the issue. I fixed a regression bug for 14.2 and forward that went out in the release of 14.2 but didn't exist before that version, for specifically a bug in not handling arrayed values correctly. The archived download page I believe only issues the 14.2.20142.1000 build which is our release build. You can confirm that by navigating to where the dll is and right clicking on it and looking for the file version. That being said, you should be able to download the latest hotfix, by after your key is registered, going to the my downloads and getting latest service release.
Hope that helps,
Is there any way to update without purchasing a license?
I've been trying to get the testadvantage free version working, but have been unable to for some unknown reason. Support most recently told me that it's because when I installed testadvantage that things got pointed at the CLR version dll's or something - instead of the free version, but since I reinstalled I haven't had any luck either. I could use some help on that issue as well - being able to attain a license seems improbable at this point.
I created a private support case for you so that we can discuss this matter about getting an updated build of TestAdvantage 14.2. The case number is CAS-169806-H6W6R4 and you can view it here.