I wan to use in . instead of using arrayList. I am trying to rework on my code.

    ArrayList<ArrayList<String>> outerList = new ArrayList<ArrayList<String>>();
        for (int a = 0; a < row.size(); a++) {
            ArrayList<String> innerList = new ArrayList<String>();
            <WebElement> column = row.get(a).findElements(By.tagName("./*[contains(@LocalizedControlType, 'text')]"));
            if(!column.isEmpty()){
                for (int j = 0; j < column.size(); j++)
                {
                    innerList.add(column.get(j).getAttribute("Name"));
                }
                outerList.add(innerList);
            }
        }
        System.out.println(outerList);



for (int i = 0; i < outerList.size(); i++) {
        if ((outerList.get(i).contains(game_date)) && (outerList.get(i).contains(home_team_name)) && (outerList.get(i).contains(away_team_name))) {
            WebElement line_up1 = AppSession.findElementByName(game_date);
            line_up1.click();
        }
    }

this is how my gui app looks like for game selection…

 Game date                   home team             away team
    06/29/2018 07:00:00 PM     Ball Hogs Ball Hogs    Tri-State Tri-State
    06/29/2018 08:00:00 PM     Power                  Ghost BALLERS
    06/29/2018 07:00:00 PM     Killer 3's             3's Company

outer list like this ::

[[06/29/2018 07:00:00 PM ,Ball Hogs Ball Hogs ,Tri-State Tri-State],[06/29/2018 08:00:00 PM, Power, Ghost BALLERS],[06/29/2018 07:00:00 PM, Killer 3's, 3's Company]]

How to use multi dimensinal array instead of using array list in java



Source link https://sqa.stackexchange.com/questions/35541/how-to-use-multi-dimensional-array-in-java-instead-of-using-array-list

LEAVE A REPLY

Please enter your comment!
Please enter your name here