java-selenium
Hi, I am recently working with selenium-java for project automation. I found that in a lot of codes are using this method.
waitForAngularRequestsToFinish();
I don't know exactly why is this in the main function. And in the next example is my code, cause I don't know what is the benefit of using at the beginning and at the end this method.
Example of this code:
public void ActualizarEstadoDeFinalizacion(String caso) {
waitForAngularRequestsToFinish();
JavascriptExecutor js = (JavascriptExecutor) getDriver();
js.executeScript("window.scrollBy(850)");
WebElement htmlScrollProblemaDeCierre = findBy(String.format("//*[@title='%s']//ancestor::div[@class='oneWorkspaceTabWrapper']//span/span[contains(.,'Estado de finalización')]//following::a[1]/parent::div/parent::div/parent::Div/parent::div",caso));
htmlScrollProblemaDeCierre.click();
waitForAngularRequestsToFinish();
}