mardi 25 décembre 2018

how to make right cycle

for(int i=0;i<=ts.listOfTasks().allTasks().size()-1;i++){
        if(ts.listOfTasks().allNamesForTask().get(i).getAttribute("title").equals(param)){
            ts.listOfTasks().allTasks().get(i).click();
        }
        else {
            TestData.SIZE_OF_TASKS=ts.listOfTasks().allTasks().size();
            js.executeScript("document.getElementsByTagName('td')["+TestData.SIZE_OF_TASKS+"].scrollIntoView()");

        }
}

I want to 1)compare all located elements with String param 2) if there are no same , scroll by js and to campare again

*But it compare only first alement and then scroll , but I want it to compare the first few located elements , and then do js *

I have tryed continue and brake with marks, but maybe do something wrong...

Aucun commentaire:

Enregistrer un commentaire