1

I'm using CSS Path to locate a list of elements. I want to find it with webDriver and fill the inputs vith values. Please take a look at my piece of code:

String CSS_PATH = "#super-product-table tbody .a-center qty-td ";
List<WebElement> list;

public int clickAllLinks() {

ArrayList<String> data = new ArrayList<String>();
    data.add(0, "1");
    data.add(1, "2");
    data.add(2, "3");

  list = driver.findElements(By.cssSelector(CSS_PATH));
    for (int a = 0; a<list.size(); a++) {
    String element = list.get(a).getCssValue("");
    System.out.println(element); 
    }

    for(int i=0; i<list.size(); i++){
        list.get(i).sendKeys(data.get(i));
    }

    return list.size();     
}

So it's not work for me. Please advice what I'm wrong with? Thank u

Chanda Korat
  • 2,453
  • 2
  • 19
  • 23
bigJava
  • 73
  • 1
  • 8
  • please see this.... http://stackoverflow.com/questions/18288333/need-to-find-element-in-selenium-by-css – KaviK Feb 15 '16 at 13:44
  • 2
    @bigJava - please provide you page source, where you want to locate your elements – Evg Evg Feb 15 '16 at 13:48

0 Answers0