Forum Discussion

HD's avatar
HD
Contributor
10 years ago

FindChild() cannot find correct object.

I am using FindChild() to find a child (in my case GridViewCell) with specific properties, but it keeps returing wrong child object.

 

Here is the scenario:

I am trying to find a GridViewCell with:

RadTreeListView.FindChild(["ClrClassName", "DataColumn.DisplayIndex", "Value.OleValue"], ["GridViewCell", 5, "ABCDEFG"], 100, true);

 

But I keep getting a GridViewCell which matches all the properties except 'Value.OleValue', here Value==null. I am not sure why FindChild is returning an objrct that does not even satisfies all the properties.

 

Can someone please help me with this

  • Issue here turned out to be "OleValue" property, which according to smartbear is dummy property inserted by TestComplete and should not be used for Finding objects. So issue is fixed if I use:

     

    RadTreeListView.FindChild(["ClrClassName", "DataColumn.DisplayIndex", "Value"], ["GridViewCell", 5, "ABCDEFG"], 100, true);

  • HD's avatar
    HD
    Contributor

    Issue here turned out to be "OleValue" property, which according to smartbear is dummy property inserted by TestComplete and should not be used for Finding objects. So issue is fixed if I use:

     

    RadTreeListView.FindChild(["ClrClassName", "DataColumn.DisplayIndex", "Value"], ["GridViewCell", 5, "ABCDEFG"], 100, true);

  • NisHera's avatar
    NisHera
    Valued Contributor

    According to documentaion ..
    When the FindChild method is used to search for an object by its name (the Name property), TestComplete ignores spaces and the following characters in the name:
    ( ) [ ] . , " '

    even though you havent explicitly used "Name" property I suspect there may be ignored character.

    insted try defining your array seperatly
    var1 = [...] var2 =[.....] etc

    FindChild(var1,var2, 100,true)

    • HD's avatar
      HD
      Contributor

      Thats not an issue here.

       

      When I do a FindChild() with "WPFControlOrdinalNo" instead of "DataColumn.DisplayIndex" in the above example, it works fine. So the issue lies somewhere else.

       

      Either I am doing something wrong or It looks like there is a bug in the  FindChild() method implementation.

      • HD's avatar
        HD
        Contributor

        Can someone please help me with this. I am stuck on this problem and can't move forward unless this gets resolved.