I am doing automation for my app. Here I am selecting a particular game.. here 3 games contain same date and same time..My script would fail if I had multiple games at same data and time. How to write my code better way. here my code, I am read all data and put it into list..Here my logic is not a better approach… my senior told me to do it in multidimensional …How to better way to check all the condition…
here list array contain 9 data .. like I am fetch gui data and put it into array… how to write better way to select a game ?

Here my database row contain game date name, home team name and away team name…i am fetch and compare here..

   ArrayList<ArrayList<String>> outer = new ArrayList<ArrayList<String>>();


                    ArrayList<String> innerInt1 = new ArrayList<String>();        

                     for(int a=0;a<itemNames.size();a++)
                     {

                     List<WebElement> date = itemNames.get(a).findElements(By.tagName("./*[contains(@LocalizedControlType, 'text')]"));

                         for(int j=0;j<date.size();j++)
                         {
                            String celtext = date.get(j).getAttribute("Name");                     
                            innerInt1.add(celtext);

                         }
                     }
                     outer.add(innerInt1);

                    if()
                   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

Here I am using every data has 1 to 9 index, so it is iterating one by one, so performance is very very poor… so if i can use inner array list. it is better way to write ..
how to check the condition ?



Source link https://sqa.stackexchange.com/questions/35464/how-to-use---array-list-in-

LEAVE A REPLY

Please enter your comment!
Please enter your name here