api

package
v2.0.0-...-b920a9c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 18, 2015 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package api provides a generic, low-level WebDriver API client for Go. All methods map directly to endpoints of the WebDriver Wire Protocol: https://code.google.com/p/selenium/wiki/JsonWireProtocol

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Element

type Element struct {
	ID      string
	Session *Session
}

func (*Element) Clear

func (e *Element) Clear() error

func (*Element) Click

func (e *Element) Click() error

func (*Element) GetAttribute

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

func (*Element) GetCSS

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

func (*Element) GetElement

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

func (*Element) GetElements

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

func (*Element) GetText

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

func (*Element) IsDisplayed

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

func (*Element) IsEnabled

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

func (*Element) IsEqualTo

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

func (*Element) IsSelected

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

func (*Element) Submit

func (e *Element) Submit() error

func (*Element) Value

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

type Log

type Log struct {
	Message   string
	Level     string
	Timestamp int64
}

type Offset

type Offset interface {
	// contains filtered or unexported methods
}

type Selector

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

type Session

type Session struct {
	Bus busSender
}

func Open

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

func (*Session) AcceptAlert

func (s *Session) AcceptAlert() error

func (*Session) Back

func (s *Session) Back() error

func (*Session) Delete

func (s *Session) Delete() error

func (*Session) DeleteCookie

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

func (*Session) DeleteCookies

func (s *Session) DeleteCookies() error

func (*Session) DeleteWindow

func (s *Session) DeleteWindow() error

func (*Session) DismissAlert

func (s *Session) DismissAlert() error

func (*Session) DoubleClick

func (s *Session) DoubleClick() error

func (*Session) Execute

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

func (*Session) Forward

func (s *Session) Forward() error

func (*Session) Frame

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

func (*Session) FrameParent

func (s *Session) FrameParent() error

func (*Session) GetActiveElement

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

func (*Session) GetAlertText

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

func (*Session) GetElement

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

func (*Session) GetElements

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

func (*Session) GetLogTypes

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

func (*Session) GetScreenshot

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

func (*Session) GetSource

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

func (*Session) GetTitle

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

func (*Session) GetURL

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

func (*Session) GetWindow

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

func (*Session) GetWindows

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

func (*Session) MoveTo

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

func (*Session) NewLogs

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

func (*Session) Refresh

func (s *Session) Refresh() error

func (*Session) SetAlertText

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

func (*Session) SetCookie

func (s *Session) SetCookie(cookie map[string]interface{}) error

func (*Session) SetURL

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

func (*Session) SetWindow

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

func (*Session) SetWindowByName

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

type WebDriver

type WebDriver struct {
	Timeout time.Duration
	Service driverService
	// contains filtered or unexported fields
}

func NewWebDriver

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

func (*WebDriver) Open

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

func (*WebDriver) Start

func (w *WebDriver) Start() error

func (*WebDriver) Stop

func (w *WebDriver) Stop() error

type Window

type Window struct {
	ID      string
	Session *Session
}

func (*Window) SetSize

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

type XOffset

type XOffset int

type XYOffset

type XYOffset struct {
	X int
	Y int
}

type YOffset

type YOffset int

Directories

Path Synopsis
internal
bus

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL