sunireddy2007
11 years agoOccasional Contributor
Dynamically updated DIV list
Hi All,
I have a webpage with main portion of the screen occupied by a DIV element with horizontal rows of DIV sections inside it. Each DIV section contains a heading and some text in various DIV elements. When the page contains more than 25 DIV sections, there is a Show More button which adds 25 more DIV sections upon its click and also a scrollbar to the right of the outer DIV container. I am able to seach for the DIV section I am interested in for the test when the page contains less than 25 DIV sections or the one I am looking/searching for is in the first 25 sections. But when I have to click the "Show More" button, even if the section I am looking for is added to the bottom of the page (outside of the view), the same script is not able to find the DIV section.
My search logic is simple. I look for all DIV elements with a certain className and I always get only 25 elements back in the call to FinadAllChildren on the Page object. It means the FindAllChildren is not able to fetch the 25 more DIV elements that are added by clicking "Show More" button.
Can anyone help?
-Sunitha.
I have a webpage with main portion of the screen occupied by a DIV element with horizontal rows of DIV sections inside it. Each DIV section contains a heading and some text in various DIV elements. When the page contains more than 25 DIV sections, there is a Show More button which adds 25 more DIV sections upon its click and also a scrollbar to the right of the outer DIV container. I am able to seach for the DIV section I am interested in for the test when the page contains less than 25 DIV sections or the one I am looking/searching for is in the first 25 sections. But when I have to click the "Show More" button, even if the section I am looking for is added to the bottom of the page (outside of the view), the same script is not able to find the DIV section.
My search logic is simple. I look for all DIV elements with a certain className and I always get only 25 elements back in the call to FinadAllChildren on the Page object. It means the FindAllChildren is not able to fetch the 25 more DIV elements that are added by clicking "Show More" button.
Can anyone help?
-Sunitha.
- Try to do a
Sys.Browser("nameOfYourBrowser").Refresh()
before calling the FindAllChildren after clicking the show more.
If this does not work, using the object spy, make sure the properties you are looking for (className) remain the same after clicking the show more.