title: handle a dynamically changing element and a scroll bar
body: <p><a href="http://i.stack.imgur.com/DOcJw.jpg" rel="nofollow">This is a screen shot of my webpage</a></p>
  
  <p>Here is the html code</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="slimScrollDiv" style="position: relative; overflow: hidden; width: auto; height: 350px;"&gt;&lt;div class="scroller" style="height: 350px; overflow: hidden; width: auto;" data-always-visible="1" data-rail-visible1="0" data-handle-color="#D7DCE2"&gt;
                  &lt;div class="tsk-row clearfix"&gt;
                     
                      &lt;div class="tsk-left"&gt;       
                                           
                          &lt;a href="/WorkTask/Update/776eab95-d7ea-4b5d-9c58-1c736e071895"&gt;New task to check new build of 2016.4.18.1 &lt;/a&gt;
                          
                      &lt;/div&gt;
                     
                          &lt;a href="/WorkTask/Index/45d76b1d-f665-4e29-b22f-5c9cd335a957"&gt;test&lt;/a&gt;
                     
                      &lt;div class="tsk-right"&gt;
                          &lt;span class="label label-warning"&gt;Assigned&lt;/span&gt;
                      &lt;/div&gt;
  
                  &lt;/div&gt;
                  &lt;div class="tsk-row clearfix"&gt;
                     
                      &lt;div class="tsk-left"&gt;       
                                           
                          &lt;a href="/WorkTask/Update/e78ed656-c8d1-4623-b2f7-a70876d80a9d"&gt; test 2&lt;/a&gt;
                          
                      &lt;/div&gt;
                     
                          &lt;a href="/WorkTask/Index/01ebc490-08d3-46f5-b9f7-139f3837e289"&gt; test&lt;/a&gt;
                     
                      &lt;div class="tsk-right"&gt;
                          &lt;span class="label label-warning"&gt;Assigned&lt;/span&gt;
                      &lt;/div&gt;
  
                  &lt;/div&gt;
                  &lt;div class="tsk-row clearfix"&gt;
                     
                      &lt;div class="tsk-left"&gt;       
                                           
                          &lt;a href="/WorkTask/Update/9a992f63-f331-4e5b-a04b-b2e2bdbaa6c1"&gt; test&lt;/a&gt;
                          
                      &lt;/div&gt;
                     
                          &lt;a href="/WorkTask/Index/01ebc490-08d3-46f5-b9f7-139f3837e289"&gt; test&lt;/a&gt;
                     
                      &lt;div class="tsk-right"&gt;
                          &lt;span class="label label-warning"&gt;Assigned&lt;/span&gt;
                      &lt;/div&gt;
  
                  &lt;/div&gt;
                  &lt;div class="tsk-row clearfix"&gt;
                     
                      &lt;div class="tsk-left"&gt;       
                                           
                          &lt;a href="/WorkTask/Update/36fe32fd-f06b-47da-99d6-b3fdc060528d"&gt; New login page&lt;/a&gt;
                          
                      &lt;/div&gt;
                     
                          &lt;a href="/WorkTask/Index/01ebc490-08d3-46f5-b9f7-139f3837e289"&gt; test&lt;/a&gt;
                     
                      &lt;div class="tsk-right"&gt;
                          &lt;span class="label label-warning"&gt;Assigned&lt;/span&gt;
                      &lt;/div&gt;
  
                  &lt;/div&gt;
                  &lt;div class="tsk-row clearfix"&gt;
                     
                      &lt;div class="tsk-left"&gt;       
                                           
                          &lt;a href="/WorkTask/Update/0af36bce-755e-4744-b17b-85be5f263bf8"&gt; new task &lt;/a&gt;
                          
                      &lt;/div&gt;
                     
                          &lt;a href="/WorkTask/Index/a7a8967d-0945-4b69-95d9-59026a1181ef"&gt;Ongoing&lt;/a&gt;
                     
                      &lt;div class="tsk-right"&gt;
                          &lt;span class="label label-warning"&gt;Assigned&lt;/span&gt;
                      &lt;/div&gt;
  
                  &lt;/div&gt;
                  &lt;div class="tsk-row clearfix"&gt;
                     
                      &lt;div class="tsk-left"&gt;       
                                           
                          &lt;a href="/WorkTask/Update/8438470a-e19d-433b-8fa6-d6ff051db570"&gt;This is testing &lt;/a&gt;
                          
                      &lt;/div&gt;
                     
                          &lt;a href="/WorkTask/Index/01ebc490-08d3-46f5-b9f7-139f3837e289"&gt; test&lt;/a&gt;
                     
                      &lt;div class="tsk-right"&gt;
                          &lt;span class="label label-warning"&gt;Assigned&lt;/span&gt;
                      &lt;/div&gt;
  
                  &lt;/div&gt;
  
                  &lt;/div&gt;
          &lt;/div&gt;&lt;div class="slimScrollBar" style="width: 7px; position: absolute; top: 0px; opacity: 0.4; display: none; border-radius: 7px; z-index: 99; right: 0px; height: 300.245px; background: rgb(0, 0, 0);"&gt;&lt;/div&gt;&lt;div class="slimScrollRail" style="width: 7px; height: 100%; position: absolute; top: 0px; display: none; border-radius: 7px; opacity: 0.2; z-index: 90; right: 0px; background: rgb(51, 51, 51);"&gt;&lt;/div&gt;&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Here is my automation test case</p>
  
  <p>public void openAllTask() throws InterruptedException{</p>
  
  <pre><code>List&lt;WebElement&gt; task=driver.findElements(By.cssSelector(".tsk-row.clearfix")); // get the list of total no of elements present in the task window
  
  System.out.println("size of i loop "+task.size());
  
  for(int i=1; i&lt;=task.size(); i++){
          //find the element one by one using xpath
      System.out.println(driver.findElement(By.xpath("html/body/div[2]/div[3]/div/div/div/div[3]/div/div[1]/div["+i+"]/div[1]/a")).getText());
  
      driver.findElement(By.xpath("html/body/div[2]/div[3]/div/div/div/div[3]/div/div[1]/div["+i+"]/div[1]/a")).click();
  
      Thread.sleep(3000);
      driver.navigate().back();
      Thread.sleep(3000);
  
      // find the scroll bar and move the scroll bar by cirten pixles 
      WebElement element=driver.findElement(By.xpath("html/body/div[2]/div[3]/div/div/div/div[3]/div/div[2]"));
  
      Actions act=new Actions(driver);
  
      act.dragAndDropBy(element, 0, (i*10)).build().perform();
      Thread.sleep(3000);         
  
      }
  </code></pre>
  
  <p>I want to select each element from the window which is highlighted and also scroll the window down so that when dynamically elements are added then I can scroll down and read all the elements.</p>