Module Make.Error
All potentital errors raised by the WebDriver protocol.
type error
=[
]
type t
=
{
error : error;
the WebDriver error
message : string;
a human readable explanation
stacktrace : string;
browser stacktrace
data : Yojson.Safe.t;
additional metadatas
}
val to_string : t -> string
to_string err
returns a debug-friendly string of the WebDriver error.
val catch : (unit -> 'a cmd) -> ?errors:error list -> (t -> 'a cmd) -> 'a cmd
catch (fun () -> cmd) ?errors (fun err -> catch)
runscmd
, catching any WebDriver exceptions from?errors
(or all if unspecified), then runscatch
if necessary with the errorerr
as an argument.Some errors are less fatal than others: it's common to catch
`no_such_element
, sleep and retry when the element in question is created by some (slow) javascript. SeeTimeouts
to add an implicit wait for this situation.
val fail : exn -> 'a cmd
fail e
raises the exceptione
.