How to use wait for progress browser time when saving data

Hi All,

If I enter the data in form and after I click on save button. There is a browser time progress bar comes on the screen.

Unable to locate the locator for the progress bar.

So can you please suggest me how to use wait in selenium in such scenarios.

Right now using static wait which is not a good option to use

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer
    Hi,
    Try to use webdriverwait until a condition occurs for eg:

    WebDriverWait Wait = new WebDriverWait(driver, TimeSpan.FromSeconds(60));
    Wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementExists(by));
    Wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementToBeClickable(_driver.FindElement(by)));
    Wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.VisibilityOfAllElementsLocatedBy(by));
Reply
  • 0
    Certified Senior Developer
    Hi,
    Try to use webdriverwait until a condition occurs for eg:

    WebDriverWait Wait = new WebDriverWait(driver, TimeSpan.FromSeconds(60));
    Wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementExists(by));
    Wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementToBeClickable(_driver.FindElement(by)));
    Wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.VisibilityOfAllElementsLocatedBy(by));
Children
No Data