Forum Discussion

nisgupta's avatar
nisgupta
Valued Contributor
6 years ago

Grid issue on web Applications

We are working on grid. We need to select the cell. But the testComplete Object Spy do not recognize this object as grid type .

Attached the screenshot. 

 

Is there any generic function that can take any grid and select the cell ?

7 Replies

  • It looks like you are using some third party extension like DvExpress or equivalent.  These tools don't always generate tables, rather they use fancy CSS to make it "look" like a table.  Your best bet would probably be to try and get an understanding of what structure this third party tool uses to construct this table.  use a name mapping of the "Table" - Panel("grdNBrjbd") and then use a FindChild/FindChildren with one of the parameters being property/values you are looking for being a textnode with text "131038" in

    e.g. 

     

    var props = ["ObjectType","contentText"];
    var values = ["TextNode","131038"];     //this may be something like "INPUT".  Also, you may want to pass the text as a parameter
    //I see you can have multiple rows with the same number, so you either have to
    //find something even more unique, or use FindAllchildren
    var panelElements = yourGridTable.FindAllChildren(props,values,5).toArray();
    var textNode = null; for(i==0;i<panelElements.length;i++
    {
    //some boolean logic
    if(panelElements[i].[EvenMoreDistinctProperty] == [distinctValue])
    {
    textNode = panelElements[i];
    break;
    }
    //though if you get here you problby could have used FindChild/FindChilEx
    //but this is here because you may find this approach needed in other places
    //where you may need an array of items
    }

    if(textNode.Exists && textNode.Parent.Exists)
    {
    textNode.Parent.Click();
    }

    You will want to add some extra property and waits just in case, but there's the general idea

    • nisgupta's avatar
      nisgupta
      Valued Contributor

      thanks for the updates .

       

      Structure is using slickgrid UI plugin.

       

       

      has anyone ever worked on slickgrid ?

       

       

      • RUDOLF_BOTHMA's avatar
        RUDOLF_BOTHMA
        Community Hero

        Wish I could help, but no.  Not familiar with it at all :smileysad: