Guest User

Untitled

a guest
Dec 13th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. let itWorked = true;
  2. let attempts = 0;
  3. do {
  4. itWorked = true;
  5. try {
  6. await this.linkThatIsCausingProblem.click();
  7. await this.driver.wait(until.elementIsVisible(this.elementThatWouldIndicateTheClickWorked), this.MAX_WAIT_FOR_PAGE_TO_UPDATE);
  8. } catch (error) {
  9. itWorked = false;
  10. await this.driver.sleep(1000);
  11. attempts ++;
  12. }
  13. } while (itWorked === false && attempts < 5);
Add Comment
Please, Sign In to add comment