admin管理员组

文章数量:1026989

I have a Angular grid (ag-grid) that will, based on scrolling/view, create div in the DOM to display data. I am writing a Selenium WebDriver test that would read the data from the grid and pare it to the data returned from the API.

Since some of the div's are not yet created (hidden behind Angular virtualization) WebDriver is not able to effectively capture the data.

Is there a way to force the grid to display all data?

I have a Angular grid (ag-grid) that will, based on scrolling/view, create div in the DOM to display data. I am writing a Selenium WebDriver test that would read the data from the grid and pare it to the data returned from the API.

Since some of the div's are not yet created (hidden behind Angular virtualization) WebDriver is not able to effectively capture the data.

Is there a way to force the grid to display all data?

Share Improve this question edited Mar 21, 2016 at 20:12 user3063502 asked Mar 21, 2016 at 18:31 user3063502user3063502 512 silver badges5 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 4

there is a setting, gridOptions.rowBuffer, that tells the grid how many extra rows to render above / below the viewport. set this to a number greater than the number of rows you have and then all rows will be rendered. or if unsure, set it to 9999999.

ps you mention 'Angular Grid' and 'Angular Virtualisation'. to be correct, it is called 'Agnostic Grid' - the ag stands for AGnostic - and also the virtualisation is not Angular, grid grid has it's own implementation of row virtualisation.

Try explicitly clicking the scrollbar or panning the scrolled area in order to bring the desired div(s) into view to force Angular to instantiate the divs. You could try scroll-into-view on a known instantiated object on the edge of the instantiated div set, which would, I imagine, kick Angular into instantiating the ones just outside the view, in anticipation of continued scrolling. Wash, rinse, repeat if desired.

Here's a possibly helpful page about scroll to element in Selenium: Scroll Element into View with Selenium

Try setting domLayout to domLayout = 'autoHeight'

I have a Angular grid (ag-grid) that will, based on scrolling/view, create div in the DOM to display data. I am writing a Selenium WebDriver test that would read the data from the grid and pare it to the data returned from the API.

Since some of the div's are not yet created (hidden behind Angular virtualization) WebDriver is not able to effectively capture the data.

Is there a way to force the grid to display all data?

I have a Angular grid (ag-grid) that will, based on scrolling/view, create div in the DOM to display data. I am writing a Selenium WebDriver test that would read the data from the grid and pare it to the data returned from the API.

Since some of the div's are not yet created (hidden behind Angular virtualization) WebDriver is not able to effectively capture the data.

Is there a way to force the grid to display all data?

Share Improve this question edited Mar 21, 2016 at 20:12 user3063502 asked Mar 21, 2016 at 18:31 user3063502user3063502 512 silver badges5 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 4

there is a setting, gridOptions.rowBuffer, that tells the grid how many extra rows to render above / below the viewport. set this to a number greater than the number of rows you have and then all rows will be rendered. or if unsure, set it to 9999999.

ps you mention 'Angular Grid' and 'Angular Virtualisation'. to be correct, it is called 'Agnostic Grid' - the ag stands for AGnostic - and also the virtualisation is not Angular, grid grid has it's own implementation of row virtualisation.

Try explicitly clicking the scrollbar or panning the scrolled area in order to bring the desired div(s) into view to force Angular to instantiate the divs. You could try scroll-into-view on a known instantiated object on the edge of the instantiated div set, which would, I imagine, kick Angular into instantiating the ones just outside the view, in anticipation of continued scrolling. Wash, rinse, repeat if desired.

Here's a possibly helpful page about scroll to element in Selenium: Scroll Element into View with Selenium

Try setting domLayout to domLayout = 'autoHeight'

本文标签: