Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8146445

java.lang.IndexOutOfBoundsException: Index: 1, Size: 1

XMLWordPrintable

    • x86_64
    • windows_7

      FULL PRODUCT VERSION :


      A DESCRIPTION OF THE PROBLEM :
      Hi Team,

      I am not able to proceed further since I am getting the error:
      Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
      at java.util.ArrayList.rangeCheck(Unknown Source)
      at java.util.ArrayList.get(Unknown Source)

      I have tried all way i am not able to select any checkboxes .Please let me know why i am getting this error.Please provide teh solution.
      I have sent the code too

      REGRESSION. Last worked in version 7u79

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :

      import java.util.List;

      import org.openqa.selenium.By;
      import org.openqa.selenium.WebDriver;
      import org.openqa.selenium.WebElement;
      import org.openqa.selenium.chrome.ChromeDriver;

      public class Production {

      public static void main(String[] args) throws InterruptedException {
      System.setProperty("webdriver.chrome.driver", "D:\\Selenium\\Chrome\\chromedriver.exe");

      WebDriver driver = new ChromeDriver();

      driver.findElement(By.xpath("html/body/form/div[4]/table/tbody/tr[2]/td[2]/div/table/tbody/tr/td/table/tbody/tr/td/center/center[2]/div/a/fieldset/div/div/table/tbody/tr/td[2]/span")).click(); //Click on Dashboard
      driver.findElement(By.xpath("html/body/form/div[4]/table/tbody/tr/td/div/center/div/table/tbody/tr/td/table/tbody/tr/td/center/center[2]/div/a/fieldset/div/div/table/tbody/tr/td[2]/span")).click(); //Click on Dashlets

      Thread.sleep(8000);

      driver.findElement(By.xpath("html/body/form/table/tbody/tr[2]/td/table/tbody/tr[1]/td/div/table/tbody/tr/td[8]/div/table/tbody/tr/td[1]/input")).click();
      WebElement box=driver.findElement(By.xpath("html/body/form/div[1]/div/div"));
      Thread.sleep(3000);

      //List<WebElement> List_checkbox=box.findElements(By.className("rcbScroll-rcbWidth"));
      List<WebElement> List_checkbox=box.findElements(By.tagName("ul"));
      System.out.println(List_checkbox.size());
      System.out.println(List_checkbox.get(1).getTagName());
      List_checkbox.get(1).click();



      }

      }



      REPRODUCIBILITY :
      This bug can be reproduced always.

      SUPPORT :
      YES

            psonal Pallavi Sonal (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: