1

I am having a table which contains 3 columns.In the 3rd column i am having dropdown menu.I want to choose delete option.I need to loop the dropdown to delete the all element.So i tried to loop the element by using id Actions.I have tried to get the size and then defined loop.

List<WebElement> trlist = wait.until(ExpectedConditions.visibilityOfAllElementsLocatedBy((By.id("Actions"))));
int l=trlist.size();
if(l!=0)
for(int i=0;i<=l;i++)
{

    //Select an option as Delete
        new Select(trlist)
                .selectByVisibleText("Delete");
}

But ,it shows the error while defining this .selectByVisibleText("Delete");,because the selectByVisibleText as string it cann't be in List WebElements type.How can i loop and define the above delete drop down option?

My table looks like below

selvi
  • 1,271
  • 2
  • 21
  • 41

0 Answers0