marionette_client

package module
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: MIT Imports: 11 Imported by: 2

README

Go Reference CI Coverage Status License

marionette_client

Mozilla Gecko Marionette client for Go.

What is Marionette

Marionette is an automation driver for Mozilla's Gecko engine. It can remotely control either the UI or the internal JavaScript of a Gecko application such as Firefox. It can control both the chrome (menus and browser functions) and the content loaded in a browsing context, allowing callers to reproduce user actions and inspect the DOM.

Marionette shares much of its API with WebDriver and adds commands for interacting with Gecko's chrome interface.

Resources

See Marionette protocol support for the current command inventory and implementation gaps.

Examples

This is an incomplete list. See the tests for more examples.

Instantiate the client
client := NewClient()
// An empty host and zero port use Marionette's defaults.
client.Connect("", 0)
// Let Marionette generate the session ID with its default capabilities.
client.NewSession("", nil)
Navigate to page
client.Navigate("http://localhost:8080/")
Perform mouse actions
import (
	"time"

	marionette "github.com/njasm/marionette_client"
)

target, err := client.FindElement(marionette.Id, "button-id")
if err != nil {
	return err
}

_, err = client.PerformActions(marionette.MouseActions("mouse",
	marionette.PointerMove(0, 0, 100*time.Millisecond, marionette.ElementOrigin(target)),
	marionette.PointerDown(0),
	marionette.Pause(50*time.Millisecond),
	marionette.PointerUp(0),
))
if err != nil {
	return err
}

// Release any depressed buttons and clear Firefox's stored input-source state.
if _, err = client.ReleaseActions(); err != nil {
	return err
}

The example moves the mouse to the center of target, presses the primary button, pauses, and releases it. Pointer moves can also use ViewportOrigin() for viewport-relative coordinates or PointerOriginCurrent() for coordinates relative to the current pointer position. PerformActions validates source IDs, origins, durations, buttons, and empty sequences before sending WebDriver:PerformActions to Firefox. ReleaseActions sends WebDriver:ReleaseActions, which releases any depressed buttons and clears all stored input sources. It is useful for cleanup after a sequence fails before its matching button release.

Send special keys

WebDriver special keys are exported as string constants, so they can be mixed with ordinary text. KeyNull releases all modifiers in an element key sequence.

input, err := client.FindElement(marionette.Id, "search")
if err != nil {
	return err
}

// Select all text, release Control, and delete the selection.
if err = input.SendKeys(marionette.KeyControl, "a", marionette.KeyNull, marionette.KeyBackspace); err != nil {
	return err
}

The constants cover the complete WebDriver key set exposed by Selenium's Python Keys, including modifiers, arrows, navigation and editing keys, number-pad keys, F1 through F12, Meta/Command, right-side modifiers, and aliases.

Keyboard sources can also be synchronized with other sources through PerformActions:

_, err = client.PerformActions(marionette.KeyboardActions("keyboard",
	marionette.KeyDownAction(marionette.KeyControl),
	marionette.KeyDownAction("a"),
	marionette.KeyUpAction("a"),
	marionette.KeyUpAction(marionette.KeyControl),
))
Change Contexts
client.SetContext(Context(CHROME))
// or
client.SetContext(Context(CONTENT))
	
Find Element
element, err := client.FindElement(Id, "html-element-id-attribute")
if err != nil {
	// handle your errors
}

// else
println(element.Id())
println(element.Enabled())
println(element.Selected())
println(element.Displayed())
println(element.TagName())
println(element.Text())
println(element.Attribute("id"))
println(element.Property("id"))
println(element.CssValue("text-decoration"))
	
// width, height, x and y
rect, err := element.Rect()
if err != nil {
    // handle your errors
}

fmt.Printf("%#v", rect)
	
// size
w, h, err := element.Size()
if err != nil {
	// handle your errors
}

fmt.Printf("width: %f, height: %f", w, h)

//location
x, y, err := element.Location()
if err != nil {
    // handle your errors
}

fmt.Printf("x: %v, y: %v", x, y)
Find Elements
collection, err := element.FindElements(TagName, "li")
if err != nil {
	// handle your errors
}

// else
for _, e := range collection {
	println(e.Id())
   	println(e.Enabled())
   	println(e.Selected())
   	println(e.Displayed())
   	println(e.TagName())
   	println(e.Text())
   	println(e.Attribute("id"))
   	println(e.CssValue("text-decoration"))
   	e.Click()
}
Execute JS Script
script := "function mySum(a, b) { return a + b; }; return mySum(arguments[0], arguments[1]);"
args := []int{1, 3} // arguments to be passed to the function
timeout := 1000     // milliseconds
sandbox := false    // new Sandbox
r, err := client.ExecuteScript(script, args, timeout, sandbox)
if err == nil {
    println(r.Value) // 4 
}
Wait(), Until() Expected condition is true.
client.Navigate("http://localhost:8080/content-loaded-later.html")

timeout := 10 * time.Second
condition := ElementIsPresent(Id, "loaded-element")
ok, webElement, err := Wait(client).For(timeout).Until(condition)

if !ok {
	log.Printf("%#v", err)
	// do your error stuff
	return
}

// cool, we've the element, let's click on it!
webElement.Click()

Running tests

Run the complete suite with:

make test

The integration test harness starts its own headless Firefox instance; do not start Firefox or reserve Marionette port 2828 beforehand. For each complete test run, the harness creates a fresh temporary profile, supplies that profile to Firefox with --profile, and launches it with --headless, --marionette, --remote-allow-system-access, --no-remote, and --new-instance. It waits for Marionette to become ready and stops Firefox during test cleanup.

By default, the harness runs firefox from PATH. Set FIREFOX_BIN to use a specific executable and optionally set FIREFOX_VERSION to require a matching version:

FIREFOX_BIN=/path/to/firefox FIREFOX_VERSION=141.0.3 make test

This automatic Firefox lifecycle applies only to the repository's tests. Applications using the library must start or otherwise provide a Marionette-enabled Firefox instance before calling Client.Connect.

Documentation

Index

Constants

View Source
const (
	MarionetteProtocolV3 = 3
	WebdriverElementKey  = "element-6066-11e4-a52e-4f735466cecf"
)
View Source
const (
	KeyNull           string = "\ue000"
	KeyCancel                = "\ue001"
	KeyHelp                  = "\ue002"
	KeyBackspace             = "\ue003"
	KeyBackSpace             = KeyBackspace
	KeyTab                   = "\ue004"
	KeyClear                 = "\ue005"
	KeyReturn                = "\ue006"
	KeyEnter                 = "\ue007"
	KeyShift                 = "\ue008"
	KeyLeftShift             = KeyShift
	KeyControl               = "\ue009"
	KeyLeftControl           = KeyControl
	KeyAlt                   = "\ue00a"
	KeyLeftAlt               = KeyAlt
	KeyPause                 = "\ue00b"
	KeyEscape                = "\ue00c"
	KeySpace                 = "\ue00d"
	KeyPageUp                = "\ue00e"
	KeyPageDown              = "\ue00f"
	KeyEnd                   = "\ue010"
	KeyHome                  = "\ue011"
	KeyLeft                  = "\ue012"
	KeyArrowLeft             = KeyLeft
	KeyUp                    = "\ue013"
	KeyArrowUp               = KeyUp
	KeyRight                 = "\ue014"
	KeyArrowRight            = KeyRight
	KeyDown                  = "\ue015"
	KeyArrowDown             = KeyDown
	KeyInsert                = "\ue016"
	KeyDelete                = "\ue017"
	KeySemicolon             = "\ue018"
	KeyEquals                = "\ue019"
	KeyNumpad0               = "\ue01a"
	KeyNumpad1               = "\ue01b"
	KeyNumpad2               = "\ue01c"
	KeyNumpad3               = "\ue01d"
	KeyNumpad4               = "\ue01e"
	KeyNumpad5               = "\ue01f"
	KeyNumpad6               = "\ue020"
	KeyNumpad7               = "\ue021"
	KeyNumpad8               = "\ue022"
	KeyNumpad9               = "\ue023"
	KeyMultiply              = "\ue024"
	KeyAdd                   = "\ue025"
	KeySeparator             = "\ue026"
	KeySubtract              = "\ue027"
	KeyDecimal               = "\ue028"
	KeyDivide                = "\ue029"
	KeyF1                    = "\ue031"
	KeyF2                    = "\ue032"
	KeyF3                    = "\ue033"
	KeyF4                    = "\ue034"
	KeyF5                    = "\ue035"
	KeyF6                    = "\ue036"
	KeyF7                    = "\ue037"
	KeyF8                    = "\ue038"
	KeyF9                    = "\ue039"
	KeyF10                   = "\ue03a"
	KeyF11                   = "\ue03b"
	KeyF12                   = "\ue03c"
	KeyMeta                  = "\ue03d"
	KeyLeftMeta              = KeyMeta
	KeyCommand               = KeyMeta
	KeyLeftCommand           = KeyCommand
	KeyZenkakuHankaku        = "\ue040"
	KeyRightShift            = "\ue050"
	KeyRightControl          = "\ue051"
	KeyRightAlt              = "\ue052"
	KeyRightMeta             = "\ue053"
	KeyLeftOption            = KeyLeftAlt
	KeyRightOption           = KeyRightAlt
)

WebDriver special-key values use Unicode's private-use area as defined by the WebDriver specification.

Variables

View Source
var RunningInDebugMode = false

Functions

func ElementIsNotPresent

func ElementIsNotPresent(by By, value string) func(f Finder) (bool, *WebElement, error)

func ElementIsPresent

func ElementIsPresent(by By, value string) func(f Finder) (bool, *WebElement, error)

Types

type ActionSequence added in v0.2.0

type ActionSequence struct {
	// contains filtered or unexported fields
}

func KeyboardActions added in v0.2.2

func KeyboardActions(id string, actions ...KeyAction) ActionSequence

func MouseActions added in v0.2.0

func MouseActions(id string, actions ...PointerAction) ActionSequence

func (ActionSequence) MarshalJSON added in v0.2.0

func (s ActionSequence) MarshalJSON() ([]byte, error)

type By

type By int

By strategy type to find elements in the DOM

const (
	Id By = 1 + iota
	Name
	ClassName
	TagName
	CssSelector
	LinkText
	PartialLinkText
	Xpath
	Anon
	AnonAttribute
)

The method to use to locate the element; one of:

"id", "name", "class name", "tag name", "css selector",
"link text", "partial link text", "xpath", "anon" and "anon
attribute". Note that the "name", "link text" and "partial
link test" methods are not supported in the chrome DOM.

:param target: The target of the search. For example, if method =

"tag", target might equal "div".  If method = "id", target would
be an element id.

:param id: If specified, search for elements only inside the element

with the specified id.

func (By) String

func (b By) String() string

String returns the value name of the strategy ("css selector", "link text", ...).

type ByStrategy added in v0.1.0

type ByStrategy interface {
	fmt.Stringer
}

type Capabilities

type Capabilities struct {
	BrowserName                   string
	BrowserVersion                string
	PlatformName                  string
	PlatformVersion               string
	SpecificationLevel            uint
	RaisesAccessibilityExceptions bool
	Rotatable                     bool
	AcceptSslCerts                bool
	TakesElementScreenshot        bool
	TakesScreenshot               bool
	Proxy                         any
	Platform                      string
	XULappId                      string
	AppBuildId                    string
	Device                        string
	Version                       string
	Command_id                    uint32
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient() *Client

func (*Client) AcceptAlert added in v0.0.2

func (c *Client) AcceptAlert() error

AcceptAlert accepts the dialog - like clicking Ok/Yes

func (*Client) AddCookie added in v0.0.2

func (c *Client) AddCookie(cookie Cookie) (*Response, error)

AddCookie Adds a cookie

func (*Client) Back

func (c *Client) Back() error

Back go back in navigation history

func (*Client) CloseChromeWindow added in v0.1.0

func (c *Client) CloseChromeWindow() (*Response, error)

CloseChromeWindow Close the currently selected chrome window.

If it is the last window currently open, the chrome window will not be closed to prevent a shutdown of Firefox. Instead, the returned list of chrome window handles is empty.

return []string Unique chrome window handles of remaining chrome windows.

error NoSuchWindowError Top-level browsing context has been discarded.

func (*Client) CloseWindow

func (c *Client) CloseWindow() (*Response, error)

CloseWindow closes current window.

func (*Client) Connect

func (c *Client) Connect(host string, port int) error

func (*Client) Context

func (c *Client) Context() (*Response, error)

Context Gets the context of the server, either "chrome" or "content".

func (*Client) DeleteAllCookies added in v0.0.2

func (c *Client) DeleteAllCookies() error

DeleteAllCookies Delete all cookies

func (*Client) DeleteCookie added in v0.0.2

func (c *Client) DeleteCookie(name string) (error, error)

DeleteCookie Deletes cookie by name

func (*Client) DeleteSession

func (c *Client) DeleteSession() error

DeleteSession Marionette currently only accepts a session id, so if we call delete session can also close the TCP Connection

func (*Client) DismissAlert added in v0.0.2

func (c *Client) DismissAlert() error

DismissAlert dismisses the dialog - like clicking No/Cancel

func (*Client) ExecuteAsyncScript added in v0.0.4

func (c *Client) ExecuteAsyncScript(script string, args []any, newSandbox bool) (*Response, error)

ExecuteAsyncScript Execute JS Script Async TODO: Add missing arguments/options

func (*Client) ExecuteScript

func (c *Client) ExecuteScript(script string, args []any, timeout uint, newSandbox bool) (*Response, error)

ExecuteScript Execute JS Script

func (*Client) FindElement

func (c *Client) FindElement(by By, value string) (*WebElement, error)

FindElement Find an element using the indicated search strategy.

func (*Client) FindElements

func (c *Client) FindElements(by By, value string) ([]*WebElement, error)

FindElements Find elements using the indicated search strategy.

func (*Client) Forward

func (c *Client) Forward() error

Forward go forward in navigation history

func (*Client) FullscreenWindow added in v0.0.3

func (c *Client) FullscreenWindow() (rect *WindowRect, err error)

FullscreenWindow Synchronously sets the user agent window to full screen as if the user had done "View > Enter Full Screen"

func (*Client) GetActiveElement added in v0.0.5

func (c *Client) GetActiveElement() (*WebElement, error)

GetActiveElement Returns the page's active element.

func (*Client) GetCapabilities added in v0.0.3

func (c *Client) GetCapabilities() (*Capabilities, error)

GetCapabilities informs the client of which WebDriver features are supported by Firefox and Marionette. They are immutable for the length of the session.

func (*Client) GetCookies added in v0.0.2

func (c *Client) GetCookies() ([]Cookie, error)

GetCookies Get all cookies

func (*Client) GetTimeouts added in v0.0.3

func (c *Client) GetTimeouts() (map[string]uint, error)

GetTimeouts Get current set timeouts

func (*Client) GetWindowHandle added in v0.0.3

func (c *Client) GetWindowHandle() (string, error)

GetWindowHandle returns the current window Id

func (*Client) GetWindowHandles added in v0.0.3

func (c *Client) GetWindowHandles() ([]string, error)

GetWindowHandles return array of window Id currently opened

func (*Client) GetWindowRect

func (c *Client) GetWindowRect() (rect *WindowRect, err error)

GetWindowRect gets window position and size

func (*Client) MaximizeWindow

func (c *Client) MaximizeWindow() (rect *WindowRect, err error)

MaximizeWindow maximizes window.

func (*Client) MinimizeWindow added in v0.0.3

func (c *Client) MinimizeWindow() (rect *WindowRect, err error)

MinimizeWindow Synchronously minimizes the user agent window as if the user pressed the minimize button.

func (*Client) Navigate

func (c *Client) Navigate(url string) (*Response, error)

Navigate open url

func (*Client) NewSession

func (c *Client) NewSession(sessionId string, cap *Capabilities) (*Response, error)

NewSession create new session

func (*Client) NewWindow added in v0.0.3

func (c *Client) NewWindow(focus bool, typ string, private bool) (*Response, error)

NewWindow opens a new top-level browsing context window.

param: type string Optional type of the new top-level browsing context. Can be one of `tab` or `window`. Defaults to `tab`.

param: focus bool Optional flag if the new top-level browsing context should be opened in foreground (focused) or background (not focused). Defaults to false.

param: private bool Optional flag, which gets only evaluated for type `window`. True if the new top-level browsing context should be a private window. Defaults to false.

return {"handle": string, "type": string} Handle and type of the new browsing context.

func (*Client) PageSource

func (c *Client) PageSource() (*Response, error)

PageSource get page source

func (*Client) PerformActions added in v0.2.0

func (c *Client) PerformActions(actions ...ActionSequence) (*Response, error)

func (*Client) Quit

func (c *Client) Quit() (*Response, error)

Quit quits the session and request browser process to terminate.

func (*Client) Refresh

func (c *Client) Refresh() error

Refresh refresh the page

func (*Client) ReleaseActions added in v0.2.2

func (c *Client) ReleaseActions() (*Response, error)

ReleaseActions releases all depressed input-source actions and clears their state.

func (*Client) Screenshot

func (c *Client) Screenshot() (string, error)

Screenshot takes a screenshot of the page.

func (*Client) SendAlertText added in v0.0.2

func (c *Client) SendAlertText(keys string) error

SendAlertText sends text to a dialog

func (*Client) SessionID

func (c *Client) SessionID() string

func (*Client) SetContext

func (c *Client) SetContext(value Context) (*Response, error)

SetContext Sets the context of the subsequent commands to be either "chrome" or "content". Must be one of "chrome" or "content" only.

func (*Client) SetImplicitTimout added in v0.0.2

func (c *Client) SetImplicitTimout(milliseconds int) (*Response, error)

SetImplicitTimout Set timeout for searching for elements.

func (*Client) SetPageLoadTimeout added in v0.0.2

func (c *Client) SetPageLoadTimeout(milliseconds int) (*Response, error)

SetPageLoadTimeout Set timeout for page loading.

func (*Client) SetScriptTimeout

func (c *Client) SetScriptTimeout(milliseconds int) (*Response, error)

SetScriptTimeout Set the timeout for asynchronous script execution.

func (*Client) SetTimeouts added in v0.0.2

func (c *Client) SetTimeouts(data map[string]int) (*Response, error)

SetTimeouts <h4>Timeouts object</h4>

<dl> <dt><code>script</code> (number) <dd>Determines when to interrupt a script that is being evaluates.

<dt><code>pageLoad</code> (number) <dd>Provides the timeout limit used to interrupt navigation of the

browsing context.

<dt><code>implicit</code> (number) <dd>Gives the timeout of when to abort when locating an element. </dl>

func (*Client) SetWindowRect

func (c *Client) SetWindowRect(rect WindowRect) error

SetWindowRect sets window position and size

func (*Client) SwitchToFrame

func (c *Client) SwitchToFrame(by By, value string) error

SwitchToFrame switch to frame - strategies: By(Id), By(Name) or name only.

func (*Client) SwitchToParentFrame

func (c *Client) SwitchToParentFrame() error

SwitchToParentFrame switch to parent frame

func (*Client) SwitchToWindow

func (c *Client) SwitchToWindow(name string) error

SwitchToWindow switch to specific window.

func (*Client) TextFromAlert added in v0.0.2

func (c *Client) TextFromAlert() (string, error)

TextFromAlert gets text from the dialog

func (*Client) Title

func (c *Client) Title() (string, error)

Title get title

func (*Client) Transport

func (c *Client) Transport(t Transporter)

func (*Client) Url

func (c *Client) Url() (string, error)

Url get current url

type Context

type Context int
const (
	Chrome Context = 1 + iota
	Content
)

func (Context) String

func (c Context) String() string

String returns the value name of the context ("chrome", "content").

type Cookie struct {
	Secure   bool   `json:"secure,omitempty"`
	Expiry   uint   `json:"expiry,omitempty"`
	Domain   string `json:"domain,omitempty"`
	HttpOnly bool   `json:"httpOnly,omitempty"`
	Name     string `json:"name"`
	Path     string `json:"path,omitempty"`
	Value    string `json:"value"`
}

type Decoder

type Decoder interface {
	Decode(buf []byte, r *Response) error
}

type DecoderEncoder

type DecoderEncoder interface {
	Decoder
	Encoder
}

func NewDecoderEncoder

func NewDecoderEncoder(protoVersion int32) (DecoderEncoder, error)

type DriverError

type DriverError struct {
	ErrorType  string `json:"Error"`
	Message    string
	Stacktrace *string
}

func (*DriverError) Error

func (e *DriverError) Error() string

func (*DriverError) String

func (e *DriverError) String() string

type ElementRect

type ElementRect struct {
	Point
	Size
}

type Encoder

type Encoder interface {
	Encode(t Transporter, command string, values any) ([]byte, error)
}

type Finder

type Finder interface {
	FindElement(by By, value string) (*WebElement, error)
	FindElements(by By, value string) ([]*WebElement, error)
}

type KeyAction added in v0.2.2

type KeyAction struct {
	// contains filtered or unexported fields
}

func KeyDownAction added in v0.2.2

func KeyDownAction(value string) KeyAction

func KeyUpAction added in v0.2.2

func KeyUpAction(value string) KeyAction

func KeyboardPause added in v0.2.2

func KeyboardPause(duration time.Duration) KeyAction

func (KeyAction) MarshalJSON added in v0.2.2

func (a KeyAction) MarshalJSON() ([]byte, error)

type MarionetteTransport

type MarionetteTransport struct {
	ApplicationType    string
	MarionetteProtocol int32
	// contains filtered or unexported fields
}

func (*MarionetteTransport) Close

func (t *MarionetteTransport) Close() error

func (*MarionetteTransport) Connect

func (t *MarionetteTransport) Connect(host string, port int) error

func (*MarionetteTransport) MessageID

func (t *MarionetteTransport) MessageID() int

func (*MarionetteTransport) Receive

func (t *MarionetteTransport) Receive() ([]byte, error)

func (*MarionetteTransport) Send

func (t *MarionetteTransport) Send(command string, values any) (*Response, error)
type Navigator interface {
	Navigate(url string) (*Response, error)
	PageSource() (*Response, error)
	Title() (string, error)
	Url() (string, error)
	Refresh() error
	Back() error
	Forward() error
}

type Point

type Point struct {
	X float32
	Y float32
}

type PointerAction added in v0.2.0

type PointerAction struct {
	// contains filtered or unexported fields
}

func Pause added in v0.2.0

func Pause(duration time.Duration) PointerAction

func PointerDown added in v0.2.0

func PointerDown(button int) PointerAction

func PointerMove added in v0.2.0

func PointerMove(x, y int, duration time.Duration, origin PointerOrigin) PointerAction

func PointerUp added in v0.2.0

func PointerUp(button int) PointerAction

func (PointerAction) MarshalJSON added in v0.2.0

func (a PointerAction) MarshalJSON() ([]byte, error)

type PointerOrigin added in v0.2.0

type PointerOrigin struct {
	// contains filtered or unexported fields
}

func ElementOrigin added in v0.2.0

func ElementOrigin(element *WebElement) PointerOrigin

func PointerOriginCurrent added in v0.2.0

func PointerOriginCurrent() PointerOrigin

func ViewportOrigin added in v0.2.0

func ViewportOrigin() PointerOrigin

type ProtoV3DecoderEncoder

type ProtoV3DecoderEncoder struct{}

func (ProtoV3DecoderEncoder) Decode

func (e ProtoV3DecoderEncoder) Decode(buf []byte, r *Response) error

func (ProtoV3DecoderEncoder) Encode

func (e ProtoV3DecoderEncoder) Encode(t Transporter, command string, values any) ([]byte, error)

type Response

type Response struct {
	MessageID   int32
	Size        int32
	Value       string
	DriverError *DriverError
}

type Size

type Size struct {
	Width  float64
	Height float64
}

type Transporter

type Transporter interface {
	MessageID() int
	Connect(host string, port int) error
	Close() error
	Send(command string, values any) (*Response, error)
	Receive() ([]byte, error)
}

type Waiter

type Waiter struct {
	// contains filtered or unexported fields
}

func Wait

func Wait(f Finder) *Waiter

func (*Waiter) For

func (w *Waiter) For(d time.Duration) *Waiter

func (*Waiter) Until

func (w *Waiter) Until(f func(c Finder) (bool, *WebElement, error)) (bool, *WebElement, error)

type WebElement

type WebElement struct {
	// contains filtered or unexported fields
}

func (*WebElement) Attribute

func (e *WebElement) Attribute(name string) string

func (*WebElement) Clear

func (e *WebElement) Clear()

func (*WebElement) Click

func (e *WebElement) Click()

func (*WebElement) CssValue

func (e *WebElement) CssValue(property string) string

func (*WebElement) Displayed

func (e *WebElement) Displayed() bool

func (*WebElement) Enabled

func (e *WebElement) Enabled() bool

func (*WebElement) FindElement

func (e *WebElement) FindElement(by By, value string) (*WebElement, error)

func (*WebElement) FindElements

func (e *WebElement) FindElements(by By, value string) ([]*WebElement, error)

func (*WebElement) GetActiveElement added in v0.0.5

func (e *WebElement) GetActiveElement() (*WebElement, error)

func (*WebElement) Id

func (e *WebElement) Id() string

func (*WebElement) Location

func (e *WebElement) Location() (*Point, error)

func (*WebElement) Property added in v0.0.6

func (e *WebElement) Property(name string) string

func (*WebElement) Rect

func (e *WebElement) Rect() (*ElementRect, error)

func (*WebElement) Screenshot

func (e *WebElement) Screenshot() (string, error)

func (*WebElement) Selected

func (e *WebElement) Selected() bool

func (*WebElement) SendKeys

func (e *WebElement) SendKeys(keys ...string) error

func (*WebElement) Size

func (e *WebElement) Size() (*Size, error)

func (*WebElement) TagName

func (e *WebElement) TagName() string

func (*WebElement) Text

func (e *WebElement) Text() string

func (*WebElement) UnmarshalJSON

func (e *WebElement) UnmarshalJSON(data []byte) error

type WindowRect

type WindowRect struct {
	X      float64
	Y      float64
	Width  float64
	Height float64
}

Jump to

Keyboard shortcuts

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