Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace wait that uses Selenium.Support #245

Closed
lefthandedgoat opened this issue Mar 13, 2016 · 1 comment
Closed

Replace wait that uses Selenium.Support #245

lefthandedgoat opened this issue Mar 13, 2016 · 1 comment

Comments

@lefthandedgoat
Copy link
Owner

Something like

let wait timeout f =
  let sw = System.Diagnostics.Stopwatch.StartNew()
  let rec innerwait timeout f =
    if sw.Elapsed.TotalSeconds >= timeout then
      raise <| WebDriverTimeoutException("Timed out!")

    try
      let result = f()
      if result <> true then
        sleep 500ms
        innerwait timeout f
    with
      | :? WebDriverTimeoutException as ex -> reraise()
      | _ ->
        sleep 500ms
        innerwait timeout f

  innerwait timeout f

This will allow dropping of this dependency.

@lefthandedgoat
Copy link
Owner Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant