Friday, March 21, 2014

Scroll Bar navigation in Selenium WebDriver

This Script can use  for  Scroll bar navigation in a  page


for (int second = 0;; second++) {
           if(second >=30){
               break;
           }
               ((RemoteWebDriver) Driver.driver).executeScript("window.scrollBy(0,200)", "");
               Thread.sleep(3000);
           }

Selenium WebDriver... Multiple Windows(Child Window and Parent Window)

For Navigating to child window form parent window, can use below command...


String Parent_Window = Driver.driver.getWindowHandle();
  for (String Child_Window : Driver.driver.getWindowHandles()) {

   Driver.driver.switchTo().window(Child_Window);
  }