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-shipment-summary-shipment']/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