0

I want to wait until ajax gets successfully loads and jquery becomes active. How could it make as a reusable function in among the methods? I'm a newbie to selenium. Your help will make me understand the concept well.

List<WebElement> shipmentList = noOfShipment.findElements(By.tagName("tr")); 
int shipmentCount = shipmentList.size(); 
for (int row=1;row<shipmentCount;row=+1) { 
    try{ 
        WebElement onOfSkuWE= driver.findElement(By.xpath(".//*[@id='fba-core-workflow-shi‌pment-summary-shipme‌​nt']/tr["+row+"]/td[‌​3]")); 
        String noOfSku = onOfSkuWE.getText(); 
        int noOfSkuValue = Integer.parseInt(noOfSku); 
        if(mskuType.equalsIgnoreCase("single")) { 
            if(noOfSku.equalsIgnoreCase("1")) { 
                driver.findElement(By.xpath("..//button["+row+"][@name='‌​Work on shipment']")).click(); 
                break; 
            } 
        }
    }
}

Thanks

Tushar Gupta - curioustushar
  • 58,085
  • 24
  • 103
  • 107
user3782636
  • 83
  • 1
  • 2
  • 13
  • Show your code please. – barak manos Nov 09 '16 at 05:14
  • 2
    Possible duplicate of http://stackoverflow.com/questions/33348600/selenium-wait-for-ajax-content-to-load-universal-approach – mhasan Nov 09 '16 at 05:15
  • List shipmentList = noOfShipment.findElements(By.tagName("tr")); int shipmentCount = shipmentList.size(); for (int row=1;row – user3782636 Nov 09 '16 at 05:30
  • 1
    don't add your code in a comment - edit the question instead, and make use of the code markup tool ... you should review [how to ask](http://stackoverflow.com/help/how-to-ask) and consider providing a [Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve) – David Nov 09 '16 at 07:19
  • Code from Comment – lokusking Nov 09 '16 at 09:20

0 Answers0