agouti: Index | Files | Directories

package api

import ""

Package api provides a generic, low-level WebDriver API client for Go. All methods map directly to endpoints of the WebDriver Wire Protocol:

This package was previously internal to the agouti package. It currently does not have a fixed API, but this will change in the near future (with the addition of adequate documentation).


Package Files

api.go element.go offset.go session.go speed.go types.go webdriver.go window.go

type Bus Uses

type Bus interface {
    Send(method, endpoint string, body, result interface{}) error

type Button Uses

type Button int
const (
    LeftButton Button = iota
type Cookie struct {
    // Name is the name of the cookie (required)
    Name string `json:"name"`

    // Value is the value of the cookie (required)
    Value string `json:"value"`

    // Path is the path of the cookie (default: "/")
    Path string `json:"path,omitempty"`

    // Domain is the domain of the cookie (default: current page domain)
    Domain string `json:"domain,omitempty"`

    // Secure is set to true for secure cookies (default: false)
    Secure bool `json:"secure,omitempty"`

    // HTTPOnly is set to true for HTTP-Only cookies (default: false)
    HTTPOnly bool `json:"httpOnly,omitempty"`

    // Expiry is the time when the cookie expires
    Expiry float64 `json:"expiry,omitempty"`

A Cookie defines a web cookie

type Element Uses

type Element struct {
    ID      string
    Session *Session

func (*Element) Clear Uses

func (e *Element) Clear() error

func (*Element) Click Uses

func (e *Element) Click() error

func (*Element) GetAttribute Uses

func (e *Element) GetAttribute(attribute string) (string, error)

func (*Element) GetCSS Uses

func (e *Element) GetCSS(property string) (string, error)

func (*Element) GetElement Uses

func (e *Element) GetElement(selector Selector) (*Element, error)

func (*Element) GetElements Uses

func (e *Element) GetElements(selector Selector) ([]*Element, error)

func (*Element) GetID Uses

func (e *Element) GetID() string

func (*Element) GetLocation Uses

func (e *Element) GetLocation() (x, y int, err error)

func (*Element) GetName Uses

func (e *Element) GetName() (string, error)

func (*Element) GetSize Uses

func (e *Element) GetSize() (width, height int, err error)

func (*Element) GetText Uses

func (e *Element) GetText() (string, error)

func (*Element) IsDisplayed Uses

func (e *Element) IsDisplayed() (bool, error)

func (*Element) IsEnabled Uses

func (e *Element) IsEnabled() (bool, error)

func (*Element) IsEqualTo Uses

func (e *Element) IsEqualTo(other *Element) (bool, error)

func (*Element) IsSelected Uses

func (e *Element) IsSelected() (bool, error)

func (*Element) Send Uses

func (e *Element) Send(method, endpoint string, body, result interface{}) error

func (*Element) Submit Uses

func (e *Element) Submit() error

func (*Element) Value Uses

func (e *Element) Value(text string) error

type Log Uses

type Log struct {
    Message   string
    Level     string
    Timestamp int64

type Offset Uses

type Offset interface {
    // contains filtered or unexported methods

type ScalarSpeed Uses

type ScalarSpeed uint

type Selector Uses

type Selector struct {
    Using string `json:"using"`
    Value string `json:"value"`

type Session Uses

type Session struct {

func New Uses

func New(sessionURL string) *Session

func NewWithClient Uses

func NewWithClient(sessionURL string, client *http.Client) *Session

func Open Uses

func Open(url string, capabilities map[string]interface{}) (*Session, error)

func OpenWithClient Uses

func OpenWithClient(url string, capabilities map[string]interface{}, client *http.Client) (*Session, error)

func (*Session) AcceptAlert Uses

func (s *Session) AcceptAlert() error

func (*Session) Back Uses

func (s *Session) Back() error

func (*Session) ButtonDown Uses

func (s *Session) ButtonDown(button Button) error

func (*Session) ButtonUp Uses

func (s *Session) ButtonUp(button Button) error

func (*Session) Click Uses

func (s *Session) Click(button Button) error

func (*Session) Delete Uses

func (s *Session) Delete() error

func (*Session) DeleteCookie Uses

func (s *Session) DeleteCookie(cookieName string) error

func (*Session) DeleteCookies Uses

func (s *Session) DeleteCookies() error

func (*Session) DeleteLocalStorage Uses

func (s *Session) DeleteLocalStorage() error

func (*Session) DeleteSessionStorage Uses

func (s *Session) DeleteSessionStorage() error

func (*Session) DeleteWindow Uses

func (s *Session) DeleteWindow() error

func (*Session) DismissAlert Uses

func (s *Session) DismissAlert() error

func (*Session) DoubleClick Uses

func (s *Session) DoubleClick() error

func (*Session) Execute Uses

func (s *Session) Execute(body string, arguments []interface{}, result interface{}) error

func (*Session) Forward Uses

func (s *Session) Forward() error

func (*Session) Frame Uses

func (s *Session) Frame(frame *Element) error

func (*Session) FrameParent Uses

func (s *Session) FrameParent() error

func (*Session) GetActiveElement Uses

func (s *Session) GetActiveElement() (*Element, error)

func (*Session) GetAlertText Uses

func (s *Session) GetAlertText() (string, error)

func (*Session) GetCookies Uses

func (s *Session) GetCookies() ([]*Cookie, error)

func (*Session) GetElement Uses

func (s *Session) GetElement(selector Selector) (*Element, error)

func (*Session) GetElements Uses

func (s *Session) GetElements(selector Selector) ([]*Element, error)

func (*Session) GetLogTypes Uses

func (s *Session) GetLogTypes() ([]string, error)

func (*Session) GetScreenshot Uses

func (s *Session) GetScreenshot() ([]byte, error)

func (*Session) GetSource Uses

func (s *Session) GetSource() (string, error)

func (*Session) GetTitle Uses

func (s *Session) GetTitle() (string, error)

func (*Session) GetURL Uses

func (s *Session) GetURL() (string, error)

func (*Session) GetWindow Uses

func (s *Session) GetWindow() (*Window, error)

func (*Session) GetWindows Uses

func (s *Session) GetWindows() ([]*Window, error)

func (*Session) Keys Uses

func (s *Session) Keys(text string) error

func (*Session) MoveTo Uses

func (s *Session) MoveTo(region *Element, offset Offset) error

func (*Session) NewLogs Uses

func (s *Session) NewLogs(logType string) ([]Log, error)

func (*Session) Refresh Uses

func (s *Session) Refresh() error

func (*Session) SetAlertText Uses

func (s *Session) SetAlertText(text string) error

func (*Session) SetCookie Uses

func (s *Session) SetCookie(cookie *Cookie) error

func (*Session) SetImplicitWait Uses

func (s *Session) SetImplicitWait(timeout int) error

func (*Session) SetPageLoad Uses

func (s *Session) SetPageLoad(timeout int) error

func (*Session) SetScriptTimeout Uses

func (s *Session) SetScriptTimeout(timeout int) error

func (*Session) SetURL Uses

func (s *Session) SetURL(url string) error

func (*Session) SetWindow Uses

func (s *Session) SetWindow(window *Window) error

func (*Session) SetWindowByName Uses

func (s *Session) SetWindowByName(name string) error

func (*Session) TouchClick Uses

func (s *Session) TouchClick(element *Element) error

func (*Session) TouchDoubleClick Uses

func (s *Session) TouchDoubleClick(element *Element) error

func (*Session) TouchDown Uses

func (s *Session) TouchDown(x, y int) error

func (*Session) TouchFlick Uses

func (s *Session) TouchFlick(element *Element, offset Offset, speed Speed) error

func (*Session) TouchLongClick Uses

func (s *Session) TouchLongClick(element *Element) error

func (*Session) TouchMove Uses

func (s *Session) TouchMove(x, y int) error

func (*Session) TouchScroll Uses

func (s *Session) TouchScroll(element *Element, offset Offset) error

func (*Session) TouchUp Uses

func (s *Session) TouchUp(x, y int) error

type Speed Uses

type Speed interface {
    // contains filtered or unexported methods

type VectorSpeed Uses

type VectorSpeed struct {
    X   int
    Y   int

type WebDriver Uses

type WebDriver struct {
    Timeout    time.Duration
    Debug      bool
    HTTPClient *http.Client
    // contains filtered or unexported fields

func NewWebDriver Uses

func NewWebDriver(url string, command []string) *WebDriver

func (*WebDriver) Open Uses

func (w *WebDriver) Open(desiredCapabilites map[string]interface{}) (*Session, error)

func (*WebDriver) Start Uses

func (w *WebDriver) Start() error

func (*WebDriver) Stop Uses

func (w *WebDriver) Stop() error

func (*WebDriver) URL Uses

func (w *WebDriver) URL() string

type Window Uses

type Window struct {
    ID      string
    Session *Session

func (*Window) Send Uses

func (w *Window) Send(method, endpoint string, body, result interface{}) error

func (*Window) SetSize Uses

func (w *Window) SetSize(width, height int) error

type XOffset Uses

type XOffset int

type XYOffset Uses

type XYOffset struct {
    X   int
    Y   int

type YOffset Uses

type YOffset int



Package api imports 10 packages (graph) and is imported by 49 packages. Updated 2019-06-13. Refresh now. Tools for package owners.