Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 99410

For loop is getting execute once only

$
0
0
for(int i=0; i<2; i++)  //Main loop
{   
    for(int popup=0; popup<2; popup++)
    {
        String companyName = companyNameList.get(popup).getText();
         System.out.println("*********************************************************************************");
         System.out.println("COMPANY NAME::::-" + companyName);
         System.out.println("*********************************************************************************");

        openPopUp.get(popup).click();
        Thread.sleep(4000);

        for(int j=0;j<5;j++)
        {                               
            System.out.println(totalNoOfEmployee.get(j).getText());                                 
        }

        Thread.sleep(4000);
        break;
    }
    Actions act = new Actions(driver);
    act.moveToElement(closePopup).click().build().perform();
    Thread.sleep(4000);
}

My above code opening first popup and displaying first 5 names of company and opening 2nd popup but not displaying the name of company. Any help will be appreciated.


Viewing all articles
Browse latest Browse all 99410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>