Documentation
¶
Index ¶
- Constants
- Variables
- func IsBase64(s string) bool
- func LoadChromeExtension(extensionPath string) (base64 string, err error)
- type Browser
- func (b *Browser) ActiveWindow() (id w3cproto.WindowHandle, err error)
- func (b *Browser) AddCookie(c w3cproto.Cookie) error
- func (b *Browser) Back() error
- func (b *Browser) Capabilities() w3cproto.Capabilities
- func (b *Browser) Close() error
- func (b *Browser) CloseActiveWindow() error
- func (b *Browser) CloseWindow(id w3cproto.WindowHandle) error
- func (b *Browser) Cookies() ([]w3cproto.Cookie, error)
- func (b *Browser) CurrentURL() (url string, err error)
- func (b *Browser) DeleteCookie(name string) error
- func (b *Browser) DeleteCookies() error
- func (b *Browser) ElementScreenshot(elementID string) (io.Reader, error)
- func (b *Browser) Execute(script string, args []interface{}) ([]byte, error)
- func (b *Browser) ExecuteAsync(script string, args []interface{}) ([]byte, error)
- func (b *Browser) FindElementByID(id string) (we WebElement, err error)
- func (b *Browser) FindElementByLinkText(text string) (we WebElement, err error)
- func (b *Browser) FindElementByXPATH(xpath string) (we WebElement, err error)
- func (b *Browser) Forward() error
- func (b *Browser) Fullscreen() error
- func (b *Browser) GetCookie(name string) (w3cproto.Cookie, error)
- func (b *Browser) GetTimeout() (w3cproto.Timeout, error)
- func (b *Browser) Maximize() error
- func (b *Browser) Minimize() error
- func (b *Browser) MoveTo(x, y int) error
- func (b *Browser) NavigateTo(u string) error
- func (b *Browser) OpenTab() (id w3cproto.WindowHandle, err error)
- func (b *Browser) OpenWindow() (id w3cproto.WindowHandle, err error)
- func (b *Browser) Refresh(ctx context.Context) error
- func (b *Browser) ResizeTo(width, height int) error
- func (b *Browser) ResizeWindow(r w3cproto.Rect) (winRect w3cproto.Rect, err error)
- func (b *Browser) ScreenPosition() (x int, y int, err error)
- func (b *Browser) ScreenSize() (width int, height int, err error)
- func (b *Browser) Screenshot() (io.Reader, error)
- func (b *Browser) ScreenshotJPG() (image.Image, error)
- func (b *Browser) ScreenshotPNG() (image.Image, error)
- func (b *Browser) SetImplicitTimeout(d time.Duration) error
- func (b *Browser) SetPageLoadTimeout(d time.Duration) error
- func (b *Browser) SetScriptTimeout(d time.Duration) error
- func (b *Browser) Source() (source string, err error)
- func (b *Browser) Status() (w3cproto.Status, error)
- func (b *Browser) SwitchTo(id w3cproto.WindowHandle) error
- func (b *Browser) SwitchToFrame(id w3cproto.FrameHandle) error
- func (b *Browser) SwitchToParentFrame() error
- func (b *Browser) Title(ctx context.Context) (title string, err error)
- func (b *Browser) UID() string
- func (b *Browser) Url(u string) error
- func (b *Browser) Windows() (ids []w3cproto.WindowHandle, err error)
- func (b *Browser) WithContext(ctx context.Context)
- type ChromeOptionsBuilder
- func (b *ChromeOptionsBuilder) AddArgument(arg ...string) *ChromeOptionsBuilder
- func (b *ChromeOptionsBuilder) AddExcludeSwitches(exclude ...string) *ChromeOptionsBuilder
- func (b *ChromeOptionsBuilder) AddExtension(base64 string) error
- func (b *ChromeOptionsBuilder) AddFirstMatch(key string, value interface{}) *ChromeOptionsBuilder
- func (b *ChromeOptionsBuilder) AddWindowTypes(types ...string) *ChromeOptionsBuilder
- func (b *ChromeOptionsBuilder) Build() w3cproto.BrowserOptions
- func (b *ChromeOptionsBuilder) MobileEmulation() *MobileEmulation
- func (b *ChromeOptionsBuilder) PerfLoggingPreferences() *PerfLoggingPreferences
- func (b *ChromeOptionsBuilder) SetAcceptInsecureCerts(flag bool) *ChromeOptionsBuilder
- func (b *ChromeOptionsBuilder) SetBinary(binPath string) *ChromeOptionsBuilder
- func (b *ChromeOptionsBuilder) SetBrowserName(name string) *ChromeOptionsBuilder
- func (b *ChromeOptionsBuilder) SetBrowserVersion(version string) *ChromeOptionsBuilder
- func (b *ChromeOptionsBuilder) SetDebuggerAddr(addr string) *ChromeOptionsBuilder
- func (b *ChromeOptionsBuilder) SetDetach(flag bool) *ChromeOptionsBuilder
- func (b *ChromeOptionsBuilder) SetLocalState(key string, value interface{}) *ChromeOptionsBuilder
- func (b *ChromeOptionsBuilder) SetMiniDumpPath(path string) *ChromeOptionsBuilder
- func (b *ChromeOptionsBuilder) SetPageLoadStrategy(strategy string) *ChromeOptionsBuilder
- func (b *ChromeOptionsBuilder) SetPlatformName(platform string) *ChromeOptionsBuilder
- func (b *ChromeOptionsBuilder) SetPref(key string, value interface{}) *ChromeOptionsBuilder
- func (b *ChromeOptionsBuilder) SetProxy(proxy *w3cproto.Proxy) *ChromeOptionsBuilder
- func (b *ChromeOptionsBuilder) SetTimeout(timeout w3cproto.Timeout) *ChromeOptionsBuilder
- func (b *ChromeOptionsBuilder) SetUnhandledPromptBehavior(prompt string) *ChromeOptionsBuilder
- func (b *ChromeOptionsBuilder) SetWindowRect(flag bool) *ChromeOptionsBuilder
- type DeviceMetrics
- type Driver
- type FirefoxOptionsBuilder
- type MobileEmulation
- type PerfLoggingPreferences
- func (pp *PerfLoggingPreferences) BufferUsageReportingIntervalMillis(v uint) *PerfLoggingPreferences
- func (pp *PerfLoggingPreferences) EnableNetwork(flag bool) *PerfLoggingPreferences
- func (pp *PerfLoggingPreferences) EnablePage(flag bool) *PerfLoggingPreferences
- func (pp *PerfLoggingPreferences) EnableTimeline(flag bool) *PerfLoggingPreferences
- func (pp *PerfLoggingPreferences) Set(key string, value interface{}) *PerfLoggingPreferences
- func (pp *PerfLoggingPreferences) TracingCategories(s string) *PerfLoggingPreferences
- type Session
- func (b *Session) Close(ctx context.Context) error
- func (b *Session) Context() w3cproto.Context
- func (b *Session) Cookies() w3cproto.Cookies
- func (b *Session) Document() w3cproto.Document
- func (b *Session) Elements() w3cproto.Elements
- func (b *Session) ExecAsyncScript(ctx context.Context, script string, args []interface{}) ([]byte, error)
- func (b *Session) ExecScript(ctx context.Context, script string, args []interface{}) ([]byte, error)
- func (b *Session) Navigation() w3cproto.Navigation
- func (b *Session) ScreenCapture() w3cproto.ScreenCapture
- func (b *Session) ScreenshotJPG(ctx context.Context) (image.Image, error)
- func (b *Session) ScreenshotPNG(ctx context.Context) (image.Image, error)
- func (b *Session) Session() w3cproto.Session
- func (b *Session) SessionID() string
- func (b *Session) Timeouts() w3cproto.Timeouts
- func (b *Session) Title(ctx context.Context) (string, error)
- func (b *Session) Url(ctx context.Context, url string) error
- type WebElement
- func (w WebElement) Attr(name string) (string, error)
- func (w WebElement) PressAddKey() error
- func (w WebElement) PressAltKey() error
- func (w WebElement) PressBackspaceKey() error
- func (w WebElement) PressCancelKey() error
- func (w WebElement) PressClearKey() error
- func (w WebElement) PressControlKey() error
- func (w WebElement) PressDecimalKey() error
- func (w WebElement) PressDeleteKey() error
- func (w WebElement) PressDivideKey() error
- func (w WebElement) PressDownArrowKey() error
- func (w WebElement) PressEndKey() error
- func (w WebElement) PressEnterKey() error
- func (w WebElement) PressEqualsKey() error
- func (w WebElement) PressEscapeKey() error
- func (w WebElement) PressF10Key() error
- func (w WebElement) PressF11Key() error
- func (w WebElement) PressF12Key() error
- func (w WebElement) PressF1Key() error
- func (w WebElement) PressF2Key() error
- func (w WebElement) PressF3Key() error
- func (w WebElement) PressF4Key() error
- func (w WebElement) PressF5Key() error
- func (w WebElement) PressF6Key() error
- func (w WebElement) PressF7Key() error
- func (w WebElement) PressF8Key() error
- func (w WebElement) PressHelpKey() error
- func (w WebElement) PressHomeKey() error
- func (w WebElement) PressInsertKey() error
- func (w WebElement) PressLeftArrowKey() error
- func (w WebElement) PressMetaKey() error
- func (w WebElement) PressMultiplyKey() error
- func (w WebElement) PressNullKey() error
- func (w WebElement) PressNumpad0Key() error
- func (w WebElement) PressNumpad1Key() error
- func (w WebElement) PressNumpad2Key() error
- func (w WebElement) PressNumpad3Key() error
- func (w WebElement) PressNumpad4Key() error
- func (w WebElement) PressNumpad5Key() error
- func (w WebElement) PressNumpad6Key() error
- func (w WebElement) PressNumpad7Key() error
- func (w WebElement) PressNumpad8Key() error
- func (w WebElement) PressNumpad9Key() error
- func (w WebElement) PressPageDownKey() error
- func (w WebElement) PressPageUpKey() error
- func (w WebElement) PressPauseKey() error
- func (w WebElement) PressReturnKey() error
- func (w WebElement) PressRightArrowKey() error
- func (w WebElement) PressSemicolonKey() error
- func (w WebElement) PressSeparatorKey() error
- func (w WebElement) PressShiftKey() error
- func (w WebElement) PressSpaceKey() error
- func (w WebElement) PressSubstractKey() error
- func (w WebElement) PressTabKey() error
- func (w WebElement) PressUpArrowKey() error
- func (w WebElement) SendKeys(keys ...w3cproto.Key) error
Constants ¶
const ( // List of command-line arguments to use when starting Chrome. Arguments with an associated value // should be separated by a '=' sign (e.g., ['start-maximized', 'user-data-dir=/tmp/temp_profile']). // See here for a list of Chrome arguments. ChromeCapabilityArgsName = "args" // Path to the Chrome executable to use (on Mac OS X, this should be the actual binary, // not just the app. e.g., '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome') ChromeCapabilityBinaryName = "binary" // A list of Chrome extensions to install on startup. Each item in the list // should be a base-64 encoded packed Chrome extension (.crx) ChromeCapabilityExtensionName = "extensions" // A dictionary with each entry consisting of the name of the preference and its value. // These preferences are applied to the Local State file in the user data folder. ChromeCapabilityLocalStateName = "localState" // A dictionary with each entry consisting of the name of the preference and its value. // These preferences are only applied to the user profile in use. // See the 'Preferences' file in Chrome's user data directory for examples. ChromeCapabilityPreferencesName = "prefs" // If false, Chrome will be quit when ChromeDriver is killed, regardless of whether the session is quit. // If true, Chrome will only be quit if the session is quit (or closed). Note, if true, and the session is not quit, // ChromeDriver cannot clean up the temporary user data directory that the running Chrome instance is using. ChromeCapabilityDetachName = "detach" // An address of a Chrome debugger server to connect to, in the form of <hostname/ip:port>, e.g. '127.0.0.1:38947' ChromeCapabilityDebuggerAddressName = "debuggerAddress" // List of Chrome command line switches to exclude that ChromeDriver by default passes when starting Chrome. // Do not prefix switches with --. ChromeCapabilityExcludeSwitchesName = "excludeSwitches" // Directory to store Chrome minidumps . (Supported only on Linux.) ChromeCapabilityMiniDumpPathName = "minidumpPath" // A dictionary with either a value for “deviceName,” or values for “deviceMetrics” and “userAgent.” // Refer to Mobile Emulation for more information. ChromeCapabilityMobileEmulationName = "mobileEmulation" // An optional dictionary that specifies performance logging preferences. See below for more information. ChromeCapabilityPerfLoggingPrefsName = "perfLoggingPrefs" // A list of window types that will appear in the list of window handles. // For access to <webview> elements, include "webview" in this list. ChromeCapabilityWindowTypesName = "windowTypes" ChromeOptionsKey = "goog:chromeOptions" )
const (
EnvChromeDriverPath = "CHROMEDRIVER_PATH"
)
Variables ¶
var ErrBase64Format = errors.New("webdriver: string does not match format base64")
Functions ¶
func LoadChromeExtension ¶
Types ¶
type Browser ¶
type Browser struct {
// contains filtered or unexported fields
}
func Chrome ¶
func Chrome(opts *ChromeOptionsBuilder) (*Browser, error)
func OpenRemoteBrowser ¶
func OpenRemoteBrowser(ctx context.Context, addr string, opts w3cproto.BrowserOptions) (*Browser, error)
OpenRemoteBrowser creates a new instance of the remote browser.
func (*Browser) ActiveWindow ¶
func (b *Browser) ActiveWindow() (id w3cproto.WindowHandle, err error)
ActiveWindow returns the ID of current window handle.
func (*Browser) Capabilities ¶
func (b *Browser) Capabilities() w3cproto.Capabilities
Capabilities returns the browser capabilities.
func (*Browser) CloseActiveWindow ¶
CloseActiveWindow closes the current window.
func (*Browser) CloseWindow ¶
func (b *Browser) CloseWindow(id w3cproto.WindowHandle) error
CloseWindow closes a window.
func (*Browser) CurrentURL ¶
CurrentURL returns the URL of the current page.
func (*Browser) DeleteCookie ¶
DeleteCookie deletes cookies by name visible to the current page.
func (*Browser) DeleteCookies ¶
DeleteCookies deletes all cookies visible to the current page.
func (*Browser) ElementScreenshot ¶
ElementScreenshot takes a screenshot of the element on the current page.
func (*Browser) Execute ¶
Execute inject a snippet of JavaScript into the page for execution in the context of the currently selected frame. The executed script is assumed to be synchronous and the result of evaluating the script is returned to the client. The script argument defines the script to execute in the form of a function body. The value returned by that function will be returned to the client. The function will be invoked with the provided args array and the values may be accessed via the arguments object in the order specified. Arguments may be any JSON-primitive, array, or JSON object.
func (*Browser) ExecuteAsync ¶
ExecuteAsync inject a snippet of JavaScript into the page for execution in the context of the currently selected frame. The executed script is assumed to be asynchronous and must signal that is done by invoking the provided callback, which is always provided as the final argument to the function. The value to this callback will be returned to the client. Asynchronous script commands may not span page loads. If an unload event is fired while waiting for a script result, an error should be returned to the client. The script argument defines the script to execute in teh form of a function body. The function will be invoked with the provided args array and the values may be accessed via the arguments object in the order specified. The final argument will always be a callback function that must be invoked to signal that the script has finished. Arguments may be any JSON-primitive, array, or JSON object.
func (*Browser) FindElementByID ¶
func (b *Browser) FindElementByID(id string) (we WebElement, err error)
FindElementByID finds an element on the page, starting from the document root.
func (*Browser) FindElementByLinkText ¶
func (b *Browser) FindElementByLinkText(text string) (we WebElement, err error)
FindElementByLinkText finds an element on the page, starting from the document root.
func (*Browser) FindElementByXPATH ¶
func (b *Browser) FindElementByXPATH(xpath string) (we WebElement, err error)
FindElementByXPATH finds an element on the page, starting from the document root.
func (*Browser) Fullscreen ¶
Fullscreen resizes the window to full screen.
func (*Browser) GetTimeout ¶
GetTimeout returns the timeouts implicit, pageLoad, script.
func (*Browser) Maximize ¶
Maximize increases the window to the maximum available size without going full-screen.
func (*Browser) NavigateTo ¶
NavigateTo navigates to a new URL.
func (*Browser) OpenTab ¶
func (b *Browser) OpenTab() (id w3cproto.WindowHandle, err error)
OpenTab creates a new tab.
func (*Browser) OpenWindow ¶
func (b *Browser) OpenWindow() (id w3cproto.WindowHandle, err error)
OpenWindow creates a new window.
func (*Browser) ResizeWindow ¶
ResizeWindow alters the size or position of the operating system window.
func (*Browser) ScreenPosition ¶
ScreenPosition returns a window position on the screen of the operating system.
func (*Browser) ScreenSize ¶
ScreenSize returns a window size on the screen of the operating system.
func (*Browser) Screenshot ¶
Screenshot takes a screenshot of the current page.
func (*Browser) ScreenshotJPG ¶
ScreenshotJPG takes a screenshot of the current page.
func (*Browser) ScreenshotPNG ¶
ScreenshotPNG takes a screenshot of the current page.
func (*Browser) SetImplicitTimeout ¶
SetImplicitTimeout sets the amount of time the browser should wait when searching for elements. The timeout will be rounded to nearest millisecond.
func (*Browser) SetPageLoadTimeout ¶
SetPageLoadTimeout sets the amount of time the browser should wait when loading a page. The timeout will be rounded to nearest millisecond.
func (*Browser) SetScriptTimeout ¶
SetScriptTimeout sets the amount of time that asynchronous scripts are permitted to run before they are aborted. The timeout will be rounded to nearest millisecond.
func (*Browser) Source ¶
Source returns a string serialization of the DOM of the current browsing context active document.
func (*Browser) Status ¶
Status returns information about whether a browser is in a state in which it can create new sessions, but may additionally include arbitrary meta information that is specific to the implementation.
func (*Browser) SwitchTo ¶
func (b *Browser) SwitchTo(id w3cproto.WindowHandle) error
SwitchTo switches between tabs or windows.
func (*Browser) SwitchToFrame ¶
func (b *Browser) SwitchToFrame(id w3cproto.FrameHandle) error
SwitchToFrame changes focus to another frame on the page.
func (*Browser) SwitchToParentFrame ¶
SwitchToParentFrame changes focus back to parent frame.
func (*Browser) Windows ¶
func (b *Browser) Windows() (ids []w3cproto.WindowHandle, err error)
Windows returns the list of all window handles(ids) available to the session.
func (*Browser) WithContext ¶
type ChromeOptionsBuilder ¶
type ChromeOptionsBuilder struct {
// contains filtered or unexported fields
}
func ChromeOptions ¶
func ChromeOptions() *ChromeOptionsBuilder
func (*ChromeOptionsBuilder) AddArgument ¶
func (b *ChromeOptionsBuilder) AddArgument(arg ...string) *ChromeOptionsBuilder
func (*ChromeOptionsBuilder) AddExcludeSwitches ¶
func (b *ChromeOptionsBuilder) AddExcludeSwitches(exclude ...string) *ChromeOptionsBuilder
func (*ChromeOptionsBuilder) AddExtension ¶
func (b *ChromeOptionsBuilder) AddExtension(base64 string) error
func (*ChromeOptionsBuilder) AddFirstMatch ¶
func (b *ChromeOptionsBuilder) AddFirstMatch(key string, value interface{}) *ChromeOptionsBuilder
func (*ChromeOptionsBuilder) AddWindowTypes ¶
func (b *ChromeOptionsBuilder) AddWindowTypes(types ...string) *ChromeOptionsBuilder
func (*ChromeOptionsBuilder) Build ¶
func (b *ChromeOptionsBuilder) Build() w3cproto.BrowserOptions
func (*ChromeOptionsBuilder) MobileEmulation ¶
func (b *ChromeOptionsBuilder) MobileEmulation() *MobileEmulation
func (*ChromeOptionsBuilder) PerfLoggingPreferences ¶
func (b *ChromeOptionsBuilder) PerfLoggingPreferences() *PerfLoggingPreferences
func (*ChromeOptionsBuilder) SetAcceptInsecureCerts ¶
func (b *ChromeOptionsBuilder) SetAcceptInsecureCerts(flag bool) *ChromeOptionsBuilder
func (*ChromeOptionsBuilder) SetBinary ¶
func (b *ChromeOptionsBuilder) SetBinary(binPath string) *ChromeOptionsBuilder
func (*ChromeOptionsBuilder) SetBrowserName ¶
func (b *ChromeOptionsBuilder) SetBrowserName(name string) *ChromeOptionsBuilder
func (*ChromeOptionsBuilder) SetBrowserVersion ¶
func (b *ChromeOptionsBuilder) SetBrowserVersion(version string) *ChromeOptionsBuilder
func (*ChromeOptionsBuilder) SetDebuggerAddr ¶
func (b *ChromeOptionsBuilder) SetDebuggerAddr(addr string) *ChromeOptionsBuilder
func (*ChromeOptionsBuilder) SetDetach ¶
func (b *ChromeOptionsBuilder) SetDetach(flag bool) *ChromeOptionsBuilder
func (*ChromeOptionsBuilder) SetLocalState ¶
func (b *ChromeOptionsBuilder) SetLocalState(key string, value interface{}) *ChromeOptionsBuilder
func (*ChromeOptionsBuilder) SetMiniDumpPath ¶
func (b *ChromeOptionsBuilder) SetMiniDumpPath(path string) *ChromeOptionsBuilder
func (*ChromeOptionsBuilder) SetPageLoadStrategy ¶
func (b *ChromeOptionsBuilder) SetPageLoadStrategy(strategy string) *ChromeOptionsBuilder
func (*ChromeOptionsBuilder) SetPlatformName ¶
func (b *ChromeOptionsBuilder) SetPlatformName(platform string) *ChromeOptionsBuilder
func (*ChromeOptionsBuilder) SetPref ¶
func (b *ChromeOptionsBuilder) SetPref(key string, value interface{}) *ChromeOptionsBuilder
func (*ChromeOptionsBuilder) SetProxy ¶
func (b *ChromeOptionsBuilder) SetProxy(proxy *w3cproto.Proxy) *ChromeOptionsBuilder
func (*ChromeOptionsBuilder) SetTimeout ¶
func (b *ChromeOptionsBuilder) SetTimeout(timeout w3cproto.Timeout) *ChromeOptionsBuilder
func (*ChromeOptionsBuilder) SetUnhandledPromptBehavior ¶
func (b *ChromeOptionsBuilder) SetUnhandledPromptBehavior(prompt string) *ChromeOptionsBuilder
func (*ChromeOptionsBuilder) SetWindowRect ¶
func (b *ChromeOptionsBuilder) SetWindowRect(flag bool) *ChromeOptionsBuilder
type DeviceMetrics ¶
type DeviceMetrics struct { Width uint `json:"width"` Height uint `json:"height"` PixelRatio float64 `json:"pixelRatio"` Touch bool `json:"touch,omitempty"` }
func (*DeviceMetrics) Capabilities ¶
func (dm *DeviceMetrics) Capabilities() w3cproto.Capabilities
type FirefoxOptionsBuilder ¶
type FirefoxOptionsBuilder struct { }
func FirefoxOptions ¶
func FirefoxOptions() *FirefoxOptionsBuilder
type MobileEmulation ¶
type MobileEmulation struct {
// contains filtered or unexported fields
}
func (*MobileEmulation) Set ¶
func (e *MobileEmulation) Set(key string, value interface{}) *MobileEmulation
func (*MobileEmulation) SetDeviceMetrics ¶
func (e *MobileEmulation) SetDeviceMetrics(m *DeviceMetrics) *MobileEmulation
func (*MobileEmulation) SetDeviceName ¶
func (e *MobileEmulation) SetDeviceName(name string) *MobileEmulation
func (*MobileEmulation) SetUserAgent ¶
func (e *MobileEmulation) SetUserAgent(agent string) *MobileEmulation
type PerfLoggingPreferences ¶
type PerfLoggingPreferences struct {
// contains filtered or unexported fields
}
func (*PerfLoggingPreferences) BufferUsageReportingIntervalMillis ¶
func (pp *PerfLoggingPreferences) BufferUsageReportingIntervalMillis(v uint) *PerfLoggingPreferences
func (*PerfLoggingPreferences) EnableNetwork ¶
func (pp *PerfLoggingPreferences) EnableNetwork(flag bool) *PerfLoggingPreferences
func (*PerfLoggingPreferences) EnablePage ¶
func (pp *PerfLoggingPreferences) EnablePage(flag bool) *PerfLoggingPreferences
func (*PerfLoggingPreferences) EnableTimeline ¶
func (pp *PerfLoggingPreferences) EnableTimeline(flag bool) *PerfLoggingPreferences
func (*PerfLoggingPreferences) Set ¶
func (pp *PerfLoggingPreferences) Set(key string, value interface{}) *PerfLoggingPreferences
func (*PerfLoggingPreferences) TracingCategories ¶
func (pp *PerfLoggingPreferences) TracingCategories(s string) *PerfLoggingPreferences
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func NewSession ¶
func NewSessionFromClient ¶
func NewSessionFromClient(ctx context.Context, client httpclient.Client, opts w3cproto.BrowserOptions) (*Session, error)
func (*Session) ExecAsyncScript ¶
func (b *Session) ExecAsyncScript(ctx context.Context, script string, args []interface{}) ([]byte, error)
ExecAsyncScript inject a snippet of JavaScript into the page for execution in the context of the currently selected frame. The executed script is assumed to be asynchronous and must signal that is done by invoking the provided callback, which is always provided as the final argument to the function. The value to this callback will be returned to the client. Asynchronous script commands may not span page loads. If an unload event is fired while waiting for a script result, an error should be returned to the client. The script argument defines the script to execute in teh form of a function body. The function will be invoked with the provided args array and the values may be accessed via the arguments object in the order specified. The final argument will always be a callback function that must be invoked to signal that the script has finished. Arguments may be any JSON-primitive, array, or JSON object.
func (*Session) ExecScript ¶
func (b *Session) ExecScript(ctx context.Context, script string, args []interface{}) ([]byte, error)
ExecScript inject a snippet of JavaScript into the page for execution in the context of the currently selected frame. The executed script is assumed to be synchronous and the result of evaluating the script is returned to the client. The script argument defines the script to execute in the form of a function body. The value returned by that function will be returned to the client. The function will be invoked with the provided args array and the values may be accessed via the arguments object in the order specified. Arguments may be any JSON-primitive, array, or JSON object.
func (*Session) Navigation ¶
func (b *Session) Navigation() w3cproto.Navigation
Navigation returns a navigation protocol.
func (*Session) ScreenCapture ¶
func (b *Session) ScreenCapture() w3cproto.ScreenCapture
ScreenCapture returns a screen capture protocol.
func (*Session) ScreenshotJPG ¶
ScreenshotJPG takes a screenshot of the current page.
func (*Session) ScreenshotPNG ¶
ScreenshotPNG takes a screenshot of the current page.
type WebElement ¶
type WebElement struct {
// contains filtered or unexported fields
}
func (WebElement) PressAddKey ¶
func (w WebElement) PressAddKey() error
func (WebElement) PressAltKey ¶
func (w WebElement) PressAltKey() error
func (WebElement) PressBackspaceKey ¶
func (w WebElement) PressBackspaceKey() error
func (WebElement) PressCancelKey ¶
func (w WebElement) PressCancelKey() error
func (WebElement) PressClearKey ¶
func (w WebElement) PressClearKey() error
func (WebElement) PressControlKey ¶
func (w WebElement) PressControlKey() error
func (WebElement) PressDecimalKey ¶
func (w WebElement) PressDecimalKey() error
func (WebElement) PressDeleteKey ¶
func (w WebElement) PressDeleteKey() error
func (WebElement) PressDivideKey ¶
func (w WebElement) PressDivideKey() error
func (WebElement) PressDownArrowKey ¶
func (w WebElement) PressDownArrowKey() error
func (WebElement) PressEndKey ¶
func (w WebElement) PressEndKey() error
func (WebElement) PressEnterKey ¶
func (w WebElement) PressEnterKey() error
func (WebElement) PressEqualsKey ¶
func (w WebElement) PressEqualsKey() error
func (WebElement) PressEscapeKey ¶
func (w WebElement) PressEscapeKey() error
func (WebElement) PressF10Key ¶
func (w WebElement) PressF10Key() error
func (WebElement) PressF11Key ¶
func (w WebElement) PressF11Key() error
func (WebElement) PressF12Key ¶
func (w WebElement) PressF12Key() error
func (WebElement) PressF1Key ¶
func (w WebElement) PressF1Key() error
func (WebElement) PressF2Key ¶
func (w WebElement) PressF2Key() error
func (WebElement) PressF3Key ¶
func (w WebElement) PressF3Key() error
func (WebElement) PressF4Key ¶
func (w WebElement) PressF4Key() error
func (WebElement) PressF5Key ¶
func (w WebElement) PressF5Key() error
func (WebElement) PressF6Key ¶
func (w WebElement) PressF6Key() error
func (WebElement) PressF7Key ¶
func (w WebElement) PressF7Key() error
func (WebElement) PressF8Key ¶
func (w WebElement) PressF8Key() error
func (WebElement) PressHelpKey ¶
func (w WebElement) PressHelpKey() error
func (WebElement) PressHomeKey ¶
func (w WebElement) PressHomeKey() error
func (WebElement) PressInsertKey ¶
func (w WebElement) PressInsertKey() error
func (WebElement) PressLeftArrowKey ¶
func (w WebElement) PressLeftArrowKey() error
func (WebElement) PressMetaKey ¶
func (w WebElement) PressMetaKey() error
func (WebElement) PressMultiplyKey ¶
func (w WebElement) PressMultiplyKey() error
func (WebElement) PressNullKey ¶
func (w WebElement) PressNullKey() error
func (WebElement) PressNumpad0Key ¶
func (w WebElement) PressNumpad0Key() error
func (WebElement) PressNumpad1Key ¶
func (w WebElement) PressNumpad1Key() error
func (WebElement) PressNumpad2Key ¶
func (w WebElement) PressNumpad2Key() error
func (WebElement) PressNumpad3Key ¶
func (w WebElement) PressNumpad3Key() error
func (WebElement) PressNumpad4Key ¶
func (w WebElement) PressNumpad4Key() error
func (WebElement) PressNumpad5Key ¶
func (w WebElement) PressNumpad5Key() error
func (WebElement) PressNumpad6Key ¶
func (w WebElement) PressNumpad6Key() error
func (WebElement) PressNumpad7Key ¶
func (w WebElement) PressNumpad7Key() error
func (WebElement) PressNumpad8Key ¶
func (w WebElement) PressNumpad8Key() error
func (WebElement) PressNumpad9Key ¶
func (w WebElement) PressNumpad9Key() error
func (WebElement) PressPageDownKey ¶
func (w WebElement) PressPageDownKey() error
func (WebElement) PressPageUpKey ¶
func (w WebElement) PressPageUpKey() error
func (WebElement) PressPauseKey ¶
func (w WebElement) PressPauseKey() error
func (WebElement) PressReturnKey ¶
func (w WebElement) PressReturnKey() error
func (WebElement) PressRightArrowKey ¶
func (w WebElement) PressRightArrowKey() error
func (WebElement) PressSemicolonKey ¶
func (w WebElement) PressSemicolonKey() error
func (WebElement) PressSeparatorKey ¶
func (w WebElement) PressSeparatorKey() error
func (WebElement) PressShiftKey ¶
func (w WebElement) PressShiftKey() error
func (WebElement) PressSpaceKey ¶
func (w WebElement) PressSpaceKey() error
func (WebElement) PressSubstractKey ¶
func (w WebElement) PressSubstractKey() error
func (WebElement) PressTabKey ¶
func (w WebElement) PressTabKey() error
func (WebElement) PressUpArrowKey ¶
func (w WebElement) PressUpArrowKey() error