Results 1 to 3 of 3

Thread: Unable to traverse a grid

  1. #1
    Sencha User
    Join Date
    Mar 2017
    Posts
    45

    Default Answered: Unable to traverse a grid

    Type: WebDriver
    ExtJS version:6.5.3.57
    ST 2.2.0.148
    Browser: Chrome v67

    I have a single column grid that can have 1 or more levels nested in a tree. When a row is clicked an additional form is displayed in second container to the right the page. I need the ability to traverse all levels of the tree so I can complete the form for each level.

    I can locate the first row and click on the first "+" icon to expand the top level of the tree then select the second row beneath it but I'm unable to expand the tree past that point.


    row0.JPGindex.JPG

    The code that will expand the first row then select the "Parent" row which activates the form. I need it to expand the "Parent" row to access the child beneath it.

    Code:
    describe('click the tree now', function() {
                it('Should select the first facility from the list', function() {
                    var grid = ST.grid('HCOTreeViewPanel treepanel[reference="FacilityGroupTreePanel"]');
                    grid
                        .rowAt(0)
                        .element('//div[contains(@class, "x-tree-expander")]')
                        .click() ; 
                    
                    grid
                        .rowAt(1)
                        .element('//div[contains(@class, "x-tree-elbow-img x-tree-elbow-plus x-tree-expander")]')
                        .click().wait(2000);
                });

  2. Try something like this, using ".down" to find the expander in the row. Using ".element" will find an element anywhere in the page - ".down" finds a child element of the row.

    Code:
    // Scenario URL: http://examples.sencha.com/extjs/6.6.0/examples/kitchensink/?classic=&profile=triton#tree-reorder
    
    
    describe('Tree', function() {
        it('Should select and expand tree nodes', function() {
            var grid = ST.grid('treepanel[title="Files"]');
            
            grid.rowWith('text', 'app')
                .click()
                .down('.x-tree-expander')
                .click();
                
            grid.rowWith('text', 'bindinspector')
                .click()
                .down('.x-tree-expander')
                .click();
                
            grid.rowWith('text', 'noconflict')
                .click()
                .down('.x-tree-expander')
                .click();
                
            grid.rowWith('text', 'BaseModel.js');
        });
    });

  3. #2
    Sencha - Sales Team daniel.gallo's Avatar
    Join Date
    Apr 2009
    Location
    Redwood City, CA
    Posts
    338
    Answers
    55

    Default

    Try something like this, using ".down" to find the expander in the row. Using ".element" will find an element anywhere in the page - ".down" finds a child element of the row.

    Code:
    // Scenario URL: http://examples.sencha.com/extjs/6.6.0/examples/kitchensink/?classic=&profile=triton#tree-reorder
    
    
    describe('Tree', function() {
        it('Should select and expand tree nodes', function() {
            var grid = ST.grid('treepanel[title="Files"]');
            
            grid.rowWith('text', 'app')
                .click()
                .down('.x-tree-expander')
                .click();
                
            grid.rowWith('text', 'bindinspector')
                .click()
                .down('.x-tree-expander')
                .click();
                
            grid.rowWith('text', 'noconflict')
                .click()
                .down('.x-tree-expander')
                .click();
                
            grid.rowWith('text', 'BaseModel.js');
        });
    });
    Daniel Gallo
    Senior Solutions Architect
    Sencha Inc.

  4. #3
    Sencha User
    Join Date
    Mar 2017
    Posts
    45

    Default

    That worked perfectly. Thanks!

Similar Threads

  1. How do I traverse grids
    By RameshM in forum Q&A
    Replies: 11
    Last Post: 30 May 2017, 2:18 PM
  2. Extjs4 how to traverse the grid line
    By lqjack in forum Ext: Q&A
    Replies: 1
    Last Post: 15 Jun 2012, 9:07 PM
  3. Traverse components by this.up and this.down
    By ctp in forum Ext: Discussion
    Replies: 1
    Last Post: 21 Aug 2011, 9:52 PM
  4. Traverse DOM Element to get Component Id
    By mrinaljena in forum Ext 3.x: Help & Discussion
    Replies: 11
    Last Post: 6 Nov 2009, 10:33 AM
  5. Dom traverse problem
    By steffenk in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 27 Apr 2009, 6:40 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •