Sign in

    mizchi/crater-webdriver-bidi/contract does not have a README file

    ApiError

    pub(all) enum ApiError {
    ElementNotFound(String)
    PageNotFound(String)
    ContextNotFound(String)
    Timeout(String)
    NavigationFailed(String, String)
    ElementNotVisible(String)
    ElementNotEnabled(String)
    EvalError(String)
    InvalidArgument(String)
    NotSupported(String)
    InternalError(String)
    } derive(
    Debug
    )

    API error
    impl Show for ApiError

    ApiMethod

    pub(all) enum ApiMethod {
    NewContext
    CloseContext(String)
    NewPage(String)
    ClosePage(String)
    Pages(String)
    Goto(String, String)
    GoBack(String)
    GoForward(String)
    Reload(String)
    Url(String)
    Title(String)
    Query(String, String)
    QueryAll(String, String)
    WaitFor(String, String, Int)
    BoundingBox(String)
    TextContent(String)
    InnerText(String)
    InnerHtml(String)
    GetAttribute(String, String)
    IsVisible(String)
    IsEnabled(String)
    IsChecked(String)
    Click(String)
    DblClick(String)
    RightClick(String)
    Hover(String)
    Focus(String)
    Fill(String, String)
    Press(String, String)
    Clear(String)
    SelectOption(String, String)
    Check(String)
    Uncheck(String)
    MouseMove(String, Double, Double)
    MouseClick(String, Double, Double, String)
    MouseDown(String, String)
    MouseUp(String, String)
    KeyboardPress(String, String)
    KeyboardType(String, String)
    Content(String)
    SetContent(String, String)
    ViewportSize(String)
    SetViewportSize(String, Int, Int)
    Evaluate(String, String)
    Screenshot(String)
    ElementScreenshot(String)
    AccessibilitySnapshot(String)
    } derive(
    Debug
    )

    All API methods as an enum for JSON-RPC dispatch
    impl Show for ApiMethod

    ApiResult

    pub(all) enum ApiResult[T] {
    Ok(T)
    Err(ApiError)
    } derive(
    Debug
    )

    API result - success or error

    Capabilities

    pub(all) struct Capabilities {
    browser_name : String
    browser_version : String
    platform_name : String
    accept_insecure_certs : Bool
    page_load_strategy : PageLoadStrategy
    proxy : ProxyConfig?
    timeouts : Timeouts
    } derive(
    Debug
    )

    Browser capabilities

    Capabilities::to_json

    fn Capabilities::to_json(self : Capabilities) -> String

    Serialize Capabilities to JSON string

    ContextId

    pub(all) struct ContextId {
    id : String
    } derive(Eq,
    Debug
    )

    Unique identifier for browser contexts

    ElementId

    pub(all) struct ElementId {
    id : String
    } derive(Eq,
    Debug
    )

    Unique identifier for browser elements

    ElementRect

    pub(all) struct ElementRect {
    x : Double
    y : Double
    width : Double
    height : Double
    } derive(
    Debug
    )

    Element rectangle (with floating point)

    ElementRect::to_json

    fn ElementRect::to_json(self : ElementRect) -> String

    Serialize ElementRect to JSON string

    ErrorCode

    pub(all) enum ErrorCode {
    ElementClickIntercepted
    ElementNotInteractable
    InsecureCertificate
    InvalidArgument
    InvalidCookieDomain
    InvalidElementState
    InvalidSelector
    InvalidSessionId
    JavascriptError
    MoveTargetOutOfBounds
    NoSuchAlert
    NoSuchCookie
    NoSuchElement
    NoSuchFrame
    NoSuchWindow
    ScriptTimeout
    SessionNotCreated
    StaleElementReference
    Timeout
    UnableToSetCookie
    UnableToCaptureScreen
    UnexpectedAlertOpen
    UnknownCommand
    UnknownError
    UnknownMethod
    UnsupportedOperation
    } derive(Eq,
    Debug
    )

    WebDriver error codes as defined in W3C spec

    ErrorCode::http_status

    fn ErrorCode::http_status(self : ErrorCode) -> Int

    HTTP status code for error

    ErrorCode::to_string

    fn ErrorCode::to_string(self : ErrorCode) -> String

    Convert error code to string

    HttpMethod

    pub(all) enum HttpMethod {
    Get
    Post
    Delete
    } derive(Eq,
    Debug
    )

    HTTP method

    LocatorStrategy

    pub(all) enum LocatorStrategy {
    CssSelector
    LinkText
    PartialLinkText
    TagName
    XPath
    } derive(Eq,
    Debug
    )

    Element location strategy

    LocatorStrategy::from_string

    fn LocatorStrategy::from_string(s : String) -> LocatorStrategy?

    Parse strategy from string

    LocatorStrategy::to_string

    fn LocatorStrategy::to_string(self : LocatorStrategy) -> String

    Convert strategy to string

    Modifiers

    pub(all) struct Modifiers {
    ctrl : Bool
    shift : Bool
    alt : Bool
    meta : Bool
    } derive(
    Debug
    )

    Keyboard modifier keys

    Modifiers::none

    fn Modifiers::none() -> Modifiers

    Default modifiers (none pressed)

    MouseButton

    pub(all) enum MouseButton {
    Left
    Right
    Middle
    } derive(Eq,
    Debug
    )

    Mouse button

    PageId

    pub(all) struct PageId {
    id : String
    } derive(Eq,
    Debug
    )

    Unique identifier for browser pages/tabs

    PageLoadStrategy

    pub(all) enum PageLoadStrategy {
    None
    Eager
    Normal
    } derive(Eq,
    Debug
    )

    Page load strategy

    PageLoadStrategy::to_json_string

    fn PageLoadStrategy::to_json_string(self : PageLoadStrategy) -> String

    Page load strategy to JSON string value

    Point

    pub(all) struct Point {
    x : Double
    y : Double
    } derive(
    Debug
    )

    Point in 2D space

    ProxyConfig

    pub(all) struct ProxyConfig {
    proxy_type : String
    proxy_autoconfig_url : String?
    ftp_proxy : String?
    http_proxy : String?
    no_proxy : Array[String]
    ssl_proxy : String?
    socks_proxy : String?
    socks_version : Int?
    } derive(
    Debug
    )

    Proxy configuration

    Rect

    pub(all) struct Rect {
    x : Double
    y : Double
    width : Double
    height : Double
    } derive(
    Debug
    )

    Rectangle with position and size

    Selector

    pub(all) enum Selector {
    Css(String)
    XPath(String)
    Text(String)
    TextContains(String)
    Role(String, String?)
    TestId(String)
    Label(String)
    Placeholder(String)
    AltText(String)
    Title(String)
    } derive(
    Debug
    )

    Element selector strategy

    Selector::to_string

    fn Selector::to_string(self : Selector) -> String

    Convert selector to string representation

    Session

    pub(all) struct Session {
    id : String
    capabilities : Capabilities
    } derive(
    Debug
    )

    Session information

    Session::to_json

    fn Session::to_json(self : Session) -> String

    Serialize Session to JSON string

    Timeouts

    pub(all) struct Timeouts {
    script : Int
    page_load : Int
    implicit : Int
    } derive(
    Debug
    )

    Timeout settings

    Timeouts::default

    fn Timeouts::default() -> Timeouts

    Default timeouts

    Timeouts::to_json

    fn Timeouts::to_json(self : Timeouts) -> String

    Serialize Timeouts to JSON string

    Viewport

    pub(all) struct Viewport {
    width : Int
    height : Int
    } derive(
    Debug
    )

    Viewport size

    WebDriverCommand

    pub(all) enum WebDriverCommand {
    Status
    NewSession
    DeleteSession(String)
    GetSession(String)
    GetTimeouts(String)
    SetTimeouts(String)
    NavigateTo(String)
    GetCurrentUrl(String)
    Back(String)
    Forward(String)
    Refresh(String)
    GetTitle(String)
    GetWindowHandle(String)
    CloseWindow(String)
    SwitchToWindow(String)
    GetWindowHandles(String)
    NewWindow(String)
    SwitchToFrame(String)
    SwitchToParentFrame(String)
    GetWindowRect(String)
    SetWindowRect(String)
    MaximizeWindow(String)
    MinimizeWindow(String)
    FullscreenWindow(String)
    FindElement(String)
    FindElements(String)
    FindElementFromElement(String, String)
    FindElementsFromElement(String, String)
    GetActiveElement(String)
    IsElementSelected(String, String)
    GetElementAttribute(String, String, String)
    GetElementProperty(String, String, String)
    GetElementCssValue(String, String, String)
    GetElementText(String, String)
    GetElementTagName(String, String)
    GetElementRect(String, String)
    IsElementEnabled(String, String)
    ElementClick(String, String)
    ElementClear(String, String)
    ElementSendKeys(String, String)
    GetPageSource(String)
    ExecuteScript(String)
    ExecuteAsyncScript(String)
    GetAllCookies(String)
    GetNamedCookie(String, String)
    AddCookie(String)
    DeleteCookie(String, String)
    DeleteAllCookies(String)
    PerformActions(String)
    ReleaseActions(String)
    DismissAlert(String)
    AcceptAlert(String)
    GetAlertText(String)
    SendAlertText(String)
    TakeScreenshot(String)
    TakeElementScreenshot(String, String)
    PrintPage(String)
    Unknown(String)
    } derive(
    Debug
    )

    WebDriver commands (endpoints)

    WebDriverError

    pub(all) struct WebDriverError {
    error : ErrorCode
    message : String
    stacktrace : String
    } derive(
    Debug
    )

    WebDriver error response

    WebDriverError::to_json

    fn WebDriverError::to_json(self : WebDriverError) -> String

    Serialize WebDriverError to JSON string

    WebDriverRequest

    pub(all) struct WebDriverRequest {
    http_method : HttpMethod
    command : WebDriverCommand
    body : String
    } derive(
    Debug
    )

    Parsed WebDriver command from HTTP request

    WebDriverResponse

    pub(all) enum WebDriverResponse {
    Success(WebDriverValue)
    Error(WebDriverError)
    } derive(
    Debug
    )

    WebDriver response (success or error)

    WebDriverResponse::to_json

    fn WebDriverResponse::to_json(self : WebDriverResponse) -> String

    Serialize WebDriverResponse to JSON string

    WebDriverValue

    pub(all) enum WebDriverValue {
    Null
    Bool(Bool)
    String(String)
    Number(Double)
    Array(Array[WebDriverValue])
    Object(Map[String, WebDriverValue])
    Element(String)
    } derive(
    Debug
    )

    WebDriver success value

    WebDriverValue::to_json

    fn WebDriverValue::to_json(self : WebDriverValue) -> String

    Serialize WebDriverValue to JSON string

    WindowRect

    pub(all) struct WindowRect {
    x : Int
    y : Int
    width : Int
    height : Int
    } derive(
    Debug
    )

    Window rectangle

    WindowRect::to_json

    fn WindowRect::to_json(self : WindowRect) -> String

    Serialize WindowRect to JSON string

    error_response

    fn error_response(code : ErrorCode, message : String) -> WebDriverResponse

    Create error response

    escape_json_string

    fn escape_json_string(s : String) -> String

    Escape string for JSON

    parse_request

    fn parse_request(method_str : String, path : String, body : String) -> WebDriverRequest

    Parse HTTP request into WebDriverRequest

    success_bool

    fn success_bool(b : Bool) -> WebDriverResponse

    Create success response with bool value

    success_element

    fn success_element(element_id : String) -> WebDriverResponse

    Create success response with element reference

    success_null

    fn success_null() -> WebDriverResponse

    Create success response with null value

    success_object

    fn success_object(map : Map[String, WebDriverValue]) -> WebDriverResponse

    Create success response with object value

    success_string

    fn success_string(s : String) -> WebDriverResponse

    Create success response with string value

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io