0

I have 3 test functions, one creates a user and then second select the created user from the list and third one deletes it. Create and Saved user function works perfectly fine, but in delete function inspite of adding various wait, it searches for the delete button when the progress bar is still overlapping it and fails. To further add, I have tried the solution provided in other questions, nothing work. My scenario is that i want to wait untill the progress bar is disappeared and then when the delete button is clickable, click it, the button is not getting clicked.

I am attaching the code for the same:

public void deleteUser(String username)
{
    wait= new WebDriverWait(driver,20);
    wait.until(ExpectedConditions.invisibilityOfElementLocated(progressbar));
    System.out.println(driver.findElement(deleteButton).getText());
    try
    {

       wait.until(ExpectedConditions.elementToBeClickable(deleteButton));
       driver.findElement(deleteButton).click();
       System.out.println("Button clicked");
       wait.until(ExpectedConditions.alertIsPresent());
    }
    catch (Exception e)
    {
      System.out.println(e);
    }

The error which I am getting:

org.openqa.selenium.WebDriverException: unknown error: Element <button type="button" ng-click="delete()" ng-disabled="readonly || isNew" class="btn btn-danger btn-sm">...</button> is not clickable at point (786, 185). Other element would receive the click: <div ng-show="inProcess" class="progress">...</div>

HTML code for delete and progress bar:

<button type="button" ng-click="delete()" ng-disabled="readonly || isNew" class="btn btn-danger btn-sm">
        <span class="glyphicon glyphicon-trash"></span>
        Delete
    </button>

<div ng-show="inProcess" class="progress ng-hide">
<div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="45" aria-valuemin="0" aria-valuemax="100" style="width: 100%">
    <span>Processing ...</span>
</div>

kritika agarwal
  • 505
  • 1
  • 6
  • 11

0 Answers0