Documentation ¶
Overview ¶
Package webdriver implements a client for the Selenium WebDriver wire protocol. It can be used with the ChromeDriver server and perhaps with the Selenium server.
This package implements the wire protocol described at http://code.google.com/p/selenium/wiki/JsonWireProtocol.
For Selenium, see http://code.google.com/p/selenium/. For ChromeDriver, see http://code.google.com/p/chromedriver/.
There is an ongoing W3C standardization effort for WebDriver at https://dvcs.w3.org/hg/webdriver/raw-file/tip/webdriver-spec.html. This package may or may not implement that protocol, depending on how close it is to the one linked above.
INCOMPLETE AND UNDOCUMENTED.
Index ¶
- type Capabilities
- type Conn
- type Cookie
- type Element
- func (e *Element) Attr(name string) (string, bool, error)
- func (e *Element) CSS(property string) (string, error)
- func (e *Element) Clear() error
- func (e *Element) Click() error
- func (e *Element) Displayed() (bool, error)
- func (e *Element) Element(by Strategy, desc string) (*Element, error)
- func (e *Element) Elements(by Strategy, desc string) ([]*Element, error)
- func (e *Element) Enabled() (bool, error)
- func (e *Element) Equal(other *Element) (bool, error)
- func (e *Element) Location() (x, y int, err error)
- func (e *Element) Name() (string, error)
- func (e *Element) Selected() (bool, error)
- func (e *Element) Size() (x, y int, err error)
- func (e *Element) Submit() error
- func (e *Element) Text() (string, error)
- func (e *Element) Value(str string) error
- type Error
- type ErrorCode
- type Failure
- type Session
- func (s *Session) ActiveElement() (*Element, error)
- func (s *Session) AlertCancel() error
- func (s *Session) AlertOK() error
- func (s *Session) AlertText() (string, error)
- func (s *Session) Back() error
- func (s *Session) CloseWindow() error
- func (s *Session) Delete() error
- func (s *Session) Element(by Strategy, desc string) (*Element, error)
- func (s *Session) Elements(by Strategy, desc string) ([]*Element, error)
- func (s *Session) Forward() error
- func (s *Session) Orientation() (string, error)
- func (s *Session) Refresh() error
- func (s *Session) SetOrientation(orientation string) error
- func (s *Session) SetTimeout(t Timeout, d time.Duration) error
- func (s *Session) SetURL(url string) error
- func (s *Session) SetWindow(w *Window) error
- func (s *Session) Source() (string, error)
- func (s *Session) Title() (string, error)
- func (s *Session) URL() (string, error)
- func (s *Session) Window() (*Window, error)
- func (s *Session) Windows() ([]*Window, error)
- type StackFrame
- type Status
- type Strategy
- type Timeout
- type Window
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Capabilities ¶
type Capabilities struct { Browser string `json:"browserName,omitempty"` Version string `json:"version,omitempty"` Platform string `json:"platform,omitempty"` Javascript bool `json:"javascriptEnabled,omitempty"` Screenshot bool `json:"takesScreenshot,omitempty"` Alert bool `json:"handlesAlerts,omitempty"` Database bool `json:"databaseEnabled,omitempty"` Location bool `json:"locationContextEnabled,omitempty"` AppCache bool `json:"applicationCacheEnabled,omitempty"` Connectivity bool `json:"browserConnectionEnabled,omitempty"` CSSSelectors bool `json:"cssSelectorsEnabled,omitempty"` WebStorage bool `json:"webStorageEnabled,omitempty"` Rotate bool `json:"rotatable,omitempty"` InsecureSSL bool `json:"acceptSslCerts,omitempty"` NativeEvents bool `json:"nativeEvents,omitempty"` }
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
func (*Conn) NewSession ¶
func (c *Conn) NewSession(cap *Capabilities) (*Session, error)
type Element ¶
type Element struct { ID string `json:"ELEMENT"` // contains filtered or unexported fields }
type ErrorCode ¶
type ErrorCode int
const ( Success ErrorCode = 0 NoSuchDriver ErrorCode = 6 NoSuchElement ErrorCode = 7 NoSuchFrame ErrorCode = 8 UnknownCommand ErrorCode = 9 StaleElementReference ErrorCode = 10 ElementNotVisible ErrorCode = 11 InvalidElementState ErrorCode = 12 UnknownError ErrorCode = 13 ElementIsNotSelectable ErrorCode = 15 JavaScriptError ErrorCode = 17 XPathLookupError ErrorCode = 19 TimeoutError ErrorCode = 21 NoSuchWindow ErrorCode = 23 InvalidCookieDomain ErrorCode = 24 UnableToSetCookie ErrorCode = 25 UnexpectedAlertOpen ErrorCode = 26 NoAlertOpenError ErrorCode = 27 ScriptTimeoutError ErrorCode = 28 InvalidElementCoordinates ErrorCode = 29 IMENotAvailable ErrorCode = 30 IMEEngineActivationFailed ErrorCode = 31 InvalidSelector ErrorCode = 32 SessionNotCreatedException ErrorCode = 33 MoveTargetOutOfBounds ErrorCode = 34 )
type Failure ¶
type Failure struct { Message string `json:"message"` Screen string `json:"screen"` // base64-encoded screenshot of page Class string `json:"class"` // class name for exception thrown StackTrace []StackFrame `json:"stackTrace"` // stack trace for exception }
type Session ¶
type Session struct { ID string `json:"id"` Capabilities `json:"capabilities"` // contains filtered or unexported fields }
func (*Session) ActiveElement ¶
func (*Session) AlertCancel ¶
func (*Session) CloseWindow ¶
func (*Session) Orientation ¶
func (*Session) SetOrientation ¶
type StackFrame ¶
type Status ¶
type Status struct { Build struct { Version string `json:"version"` // release label Revision string `json:"revision"` // revision of local source control client Time string `json:"time"` // build timestamp (format unspecified) } `json:"build"` OS struct { Arch string `json:"arch"` // system architecture Name string `json:"name"` // name of operating system Version string `json:"version"` // version of operating system } `json:"os"` }