try{
int count = 1;
do{
driver.findElement(By.xpath(".//*[@id='item_list']/li[" + count + "]/ul/li[3]/div")).click();
count++;
}
while(driver.findElement(By.xpath(".//*[@id='item_list']/li[1]/ul/li[5]/div/span")).getText().toString().equals("CLOSED"));
driver.findElement(By.xpath(".//*[@id='js_single_statement']/div[1]/header/div/ul[2]/li[2]/a")).click();
driver.findElement(By.cssSelector(".menu_group .rlink")).click();
driver.switchTo().alert().accept();
}catch(Exception e){
Reporter.log("Invoice list is empty");
}
public void closeInvoice(){
driver.findElement(By.xpath(".//*[@id='invoices']/a")).click();
driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
try{
int count = 1;
do{
count++;
}
while(driver.findElement(By.xpath(".//*[@id='item_list']/li[" + count + "]/ul/li[5]/div/span")).getText().toString().equals("CLOSED"));
driver.findElement(By.xpath(".//*[@id='item_list']/li[" + count + "]/ul/li[5]/div/span")).click();
//Get label name
label_name = driver.findElement(By.xpath(".//*[@id='inv_sum']/dt/span")).getText().toString();
driver.findElement(By.xpath(".//*[@id='js_single_statement']/div[1]/header/div/ul[2]/li[2]/a")).click();
driver.findElement(By.xpath(".//*[@id='js_single_statement']/div[1]/header/div/ul[2]/li[2]/ul/li[11]/a")).click();
driver.switchTo().alert().accept();
WebDriverWait wait = new WebDriverWait(driver, 30);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.className("closed_tag")));
}catch(Exception e){
Reporter.log("Invoice list is empty");
}
}
WebDriverWait wait = new WebDriverWait(driver, 30);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector(".icon-users")));
Like this
@Test
public void TC9() {
driver.findElement(By.cssSelector(".icon-users"));
WebDriverWait wait = new WebDriverWait(driver, 30);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector(".icon-users")));
}
As well as Why are u use TC9() method, it is only select the element. you are not using it.
--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/iOnoRAwOB6A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/43a4df0a-87d6-42f3-a043-648b35544a45%40googlegroups.com.
--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/iOnoRAwOB6A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/3a3c44a3-4d52-425e-bac3-6acc9139dc40%40googlegroups.com.