Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
50
How to fetch the cell Value and Where the Column names are filters in Xamdatagrid Using Test Complete????
posted

Hi, My Xamdatagrid will be in the Strucuture below Am trying to automate this with the help of test Complete tool Gird->DataRecord->DataCellArea->ContentItemGrid-> CellValuePresenter->XamMAskedEditor I am trying to fetch the cell value based on the filters in the xamdatagrid using Content Property in CellValuePresenter, Looping through cellvalue prsenters I am retrieving the data But For Some cells The Content will be an "Object" or "NullObject", For Some Cells it is directly displaying Cell Value, While Am running my function For the Object Values it is throwing an error "Object Variable not Set". If i set the Object for that content and reterive the values using olevalue but for some cells olevalue is not available instead value,As string is available. Am New to this test complete tool, Which Property will be used to fetch the data??? I used wvalue property but wvalue property is not displaying the run time grid values, instead it is showing some other values. Is there any other way to automate this grid. I need to check the values based on the Filters which applied in Xamdatagrid. Kindly help me out in this.

  • 138253
    Offline posted

    Hello, 

     

    Thank you for your post. I have been looking into your description and I will need some clarification on your scenario. Would you please provide me with the following information so I will be able to provide you with more accurate assistance on the matter: 

     

    1. Your operating system and processor (x86 or x64)

    2. The QTP version that you are using

    3. The patches that you have installed and the order in which they are installed (if possible a screenshot of the View Installed Updates on the Programs and Features of the Control panel)

    4. Is the TestAdvantage installed after the QTP and the patches are installed and the QTP was started.

    5. The layout of the application and if possible, the application itself, in order to be able to reproduce the issue and investigate what might be the reason for it, more accurately.

     

    Looking forward to hearing from you.

  • 7695
    Offline posted

    Hi, 
       I take it you are looping through both your rows, and inside that your columns and handling them all with the same logic. In which case I would suggest having some if statements to handle each column separately. Or just loop through the rows, and handle the columns individually.
      Also I am assuming your are using GetCellData to get the Cell's data? Which I imagine what you are experiencing is, for some columns it sounds like the data is an unserializable object, such that QTP\UFT doesn't know how to handle it. In those cases I would use GetSubItemProperty to get the data for the Cell. The reason being you can dig deeper into the object before it moves it transfers from our proxy to QTP\UFT to a more verifiable Value Type property such as:

    SET grid = WpfWindow("Samples Browser").XamDataGrid("XamDataGrid1")
    msgbox grid.GetSubItemProperty(gridCell, "{0}[EmployeeID]", "Value.subPropertyName")

    If you don't know the sub properties of the object you could use either GetSubItemProperties method, or the open source program Snoop to dig into the property structure of the control. Snoop shows the UIElement structure of your application. To access the UIElement of the cell, we added in a custom property called FWElement and CellValuePresenter which will both return the corresponding CellValuePresenter for the Cell. Which along with the Children and ChildCount properties will allow you to traverse the the UIElement structure to get at any property related to the cell. 

    Using Snoop will make identifying the properties easier, but it is possible to do it with just the GetSubItemProperties and GetSubItemProprety methods.

    This for example will show all the properties available on the Content of the CellValuePresenter: 

    msgbox grid.GetSubItemProperties(gridCell, "{0}[EmployeeID]", "FWElement.Content")

    Where to get Snoop:

    http://snoopwpf.codeplex.com/
    I hope this helps,

  • 138253
    Offline posted

    Hello Keerthi,

     

    I am just checking if you got this worked out or you still require any assistance or clarification on the matter.