Documentation
¶
Index ¶
- Constants
- type Cookie
- type Driver
- type Element
- func (e *Element) Attr(name string) (string, error)
- func (e *Element) Clear() error
- func (e *Element) Click() error
- func (e *Element) Css(name string) (string, error)
- func (e *Element) Displayed() (bool, error)
- func (e *Element) Element(using FindStrategy, value string) (*Element, error)
- func (e *Element) Elements(using FindStrategy, value string) ([]*Element, error)
- func (e *Element) Enabled() (bool, error)
- func (e *Element) Equals(o *Element) (bool, error)
- func (e *Element) Html() (string, error)
- func (e *Element) Location() (*pos, error)
- func (e *Element) Name() (string, error)
- func (e *Element) Selected() (bool, error)
- func (e *Element) Size() (*size, error)
- func (e *Element) Submit() error
- func (e *Element) Text() (string, error)
- func (e *Element) Value(sequence string) error
- type FindStrategy
- type Session
- func (s *Session) AcceptAlert() error
- func (s *Session) Active() (*Element, error)
- func (s *Session) AlertText() (string, error)
- func (s *Session) ApplicationCacheStatus() (int, error)
- func (s *Session) Back() error
- func (s *Session) ButtonDown(button int) error
- func (s *Session) ButtonUp(button int) error
- func (s *Session) Click(button int) error
- func (s *Session) Cookie(name string) *Cookie
- func (s *Session) Cookies() ([]Cookie, error)
- func (s *Session) CookiesClear() error
- func (s *Session) Delete() error
- func (s *Session) DismissAlert() error
- func (s *Session) DoubleClick() error
- func (s *Session) Element(using FindStrategy, value string) (*Element, error)
- func (s *Session) Elements(using FindStrategy, value string) ([]*Element, error)
- func (s *Session) ExecuteAsync(script string, args []interface{}) ([]byte, error)
- func (s *Session) ExecuteSync(script string, args []interface{}) ([]byte, error)
- func (s *Session) Forward() error
- func (s *Session) Load(url string) error
- func (s *Session) LocalStorageClear() error
- func (s *Session) LocalStorageDelKey(key string) error
- func (s *Session) LocalStorageGetKey(key string) (string, error)
- func (s *Session) LocalStorageKeys() ([]string, error)
- func (s *Session) LocalStorageSetKey(key, value string) error
- func (s *Session) LocalStorageSize() (int, error)
- func (s *Session) Move(e *Element, x, y int) error
- func (s *Session) Refresh() error
- func (s *Session) RespondAlert(text string) error
- func (s *Session) Screenshot() (io.Reader, error)
- func (s *Session) SessionStorageClear() error
- func (s *Session) SessionStorageDelKey(key string) error
- func (s *Session) SessionStorageGetKey(key string) (string, error)
- func (s *Session) SessionStorageKeys() ([]string, error)
- func (s *Session) SessionStorageSetKey(key, value string) error
- func (s *Session) SessionStorageSize() (int, error)
- func (s *Session) Source() (string, error)
- func (s *Session) Timeouts(what string, ms int) error
- func (s *Session) TimeoutsAsyncScript(ms int) error
- func (s *Session) TimeoutsImplicitWait(ms int) error
- func (s *Session) Title() (string, error)
- func (s *Session) TouchClick(e *Element) error
- func (s *Session) TouchDoubleClick(e *Element) error
- func (s *Session) TouchDown(x, y int) error
- func (s *Session) TouchFlick(e *Element, x, y, speed int) error
- func (s *Session) TouchFlickAnywhere(xspeed, yspeed int) error
- func (s *Session) TouchLongClick(e *Element) error
- func (s *Session) TouchMove(x, y int) error
- func (s *Session) TouchScroll(e *Element, x, y int) error
- func (s *Session) TouchUp(x, y int) error
- func (s *Session) Url() (string, error)
- func (s *Session) Window() *Window
- type Window
Constants ¶
const ( // FindByClass finds eelements whose class name contains the search value. FindByClass FindStrategy = "class name" // FindByCss finds elements matching a CSS selector. FindByCss = "css selector" // FindById finds elements whose ID attribute matches the search value. FindById = "id" // FindByName an element whose NAME attribute matches the search value. FindByName = "name" // FindByLinkText finds links whose visible text matches the search value. FindByLinkText = "link text" // FindByPartialLinkText finds links whose text partially matches the search value. FindByPartialLinkText = "partial link text" // FindByTagName finds elements whose tag name matches the search value. FindByTagName = "tag name" // XPath finds elements matching an XPath expression. XPath = "xpath" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cookie ¶
type Cookie struct {
Name string `json:"name"`
Value string `json:"value"`
Path string `json:"path"`
Domain string `json:"domain"`
Secure bool `json:"secure"`
Expiry int `json:"expiry"`
// contains filtered or unexported fields
}
Cookie represents a web cookie.
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
Driver represents a WebDriver instance
func (*Driver) Session ¶
Session creates a new WebDriver session, launching a new remote browser instance.
type Element ¶
type Element struct {
ID string `json:"ELEMENT"`
// contains filtered or unexported fields
}
Element represents a web element within a page.
func (*Element) Element ¶
func (e *Element) Element(using FindStrategy, value string) (*Element, error)
Element searches for a single element on the page, starting from this element.
func (*Element) Elements ¶
func (e *Element) Elements(using FindStrategy, value string) ([]*Element, error)
Elements searches for multiple elements on the page, starting from this element.
type FindStrategy ¶
type FindStrategy string
FindStrategy specifies which strategy to use when searching for elements.
type Session ¶
type Session struct {
ID string `json:"id"`
CB map[string]interface{} `json:"capabilities"`
// contains filtered or unexported fields
}
Session represents a web page session.
func (*Session) AcceptAlert ¶
AcceptAlert accepts the currently displayed alert dialog window.
func (*Session) ApplicationCacheStatus ¶
ApplicationCacheStatus returns the current application cache status for the current page.
func (*Session) Back ¶
Back causes the browser to traverse one step backwards in the session history.
func (*Session) ButtonDown ¶
ButtonDown clicks and holds the specified mouse button at the current coordinates.
func (*Session) CookiesClear ¶
CookiesClear removes all cookies visible to the current page.
func (*Session) DismissAlert ¶
DismissAlert cancels the currently displayed alert dialog window.
func (*Session) DoubleClick ¶
DoubleClick double clicks the left mouse button at the current coordinates.
func (*Session) Element ¶
func (s *Session) Element(using FindStrategy, value string) (*Element, error)
Element searches for a single element from within the current page.
func (*Session) Elements ¶
func (s *Session) Elements(using FindStrategy, value string) ([]*Element, error)
Elements searches for multiple elements from within the current page.
func (*Session) ExecuteAsync ¶
ExecuteAsync executes a JavaScript script asynchronously in the current page.
func (*Session) ExecuteSync ¶
ExecuteSync executes a JavaScript script synchronously in the current page.
func (*Session) Forward ¶
Forward causes the browser to traverse one step forwards in the session history.
func (*Session) LocalStorageClear ¶
LocalStorageClear clears the localStorage of the current page.
func (*Session) LocalStorageDelKey ¶
LocalStorageDelKey deletes the specified key from localStorage on the current page.
func (*Session) LocalStorageGetKey ¶
LocalStorageGetKey gets the specified localStorage key on the current page.
func (*Session) LocalStorageKeys ¶
LocalStorageKeys returns all of the localStorage keys for the current page.
func (*Session) LocalStorageSetKey ¶
LocalStorageSetKey sets the specified key in localStorage on the current page.
func (*Session) LocalStorageSize ¶
LocalStorageSize returns the current localStorage content size.
func (*Session) RespondAlert ¶
RespondAlert sends keystrokes to the currently displayed dialog window.
func (*Session) Screenshot ¶
Screenshot takes a screenshot of the full browser viewport.
func (*Session) SessionStorageClear ¶
SessionStorageClear clears the sessionStorage of the current page.
func (*Session) SessionStorageDelKey ¶
SessionStorageDelKey deletes the specified key from sessionStorage on the current page.
func (*Session) SessionStorageGetKey ¶
SessionStorageGetKey gets the specified sessionStorage key on the current page.
func (*Session) SessionStorageKeys ¶
SessionStorageKeys returns all of the sessionStorage keys for the current page.
func (*Session) SessionStorageSetKey ¶
SessionStorageSetKey sets the specified key in sessionStorage on the current page.
func (*Session) SessionStorageSize ¶
SessionStorageSize returns the current sessionStorage content size.
func (*Session) TimeoutsAsyncScript ¶
TimeoutsAsyncScript specifies a custom timeout when running asynchronous scripts.
func (*Session) TimeoutsImplicitWait ¶
TimeoutsImplicitWait specifies a custom timeout when searching for elements on the page.
func (*Session) TouchClick ¶
TouchClick executes a single tap at the current coordinates.
func (*Session) TouchDoubleClick ¶
TouchDoubleClick executes a double click on the specified element.
func (*Session) TouchFlick ¶
TouchFlick flicks a finger on the screen starting at the specified element.
func (*Session) TouchFlickAnywhere ¶
TouchFlickAnywhere flicks a finger on the screen starting anywhere.
func (*Session) TouchLongClick ¶
TouchLongClick executes a long tap on the specified element.
func (*Session) TouchScroll ¶
TouchScroll scrolls on the page using finger based motion events.