I have a task of sending images which does a few clicks, but I would like to repeat this process n times. Is there a way I could use a for or any other alternate way of doing it ?

WebElement selectplusButton = driver.findElement(By.id("xxxxx/add_button"));
                selectplusButton.click();
                System.out.println("Plus button Clicked");
                Thread.sleep(500);

            WebElement optionImage = driver.findElement(By.id("xxxxxxx/choose_image_btn"));
            optionImage.click();
            System.out.println("Image option Selected");
            Thread.sleep(500);

            WebElement selectimageFolder = driver.findElement(By.id("com.google.android.apps.photos:id/subtitle"));
            selectimageFolder.click();
            System.out.println("Image Folder Selected");
            Thread.sleep(500);



Source link https://sqa.stackexchange.com/questions/35157/how-to-loop-a--of--in-

LEAVE A REPLY

Please enter your comment!
Please enter your name here