webdriver

package
v0.91.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: Apache-2.0 Imports: 44 Imported by: 0

README

webdriver Runner

webdriver runner opens a web session to run a various action on web driver or web elements.

Service Id Action Description Request Response
webdriver start start standalone webdriver server ServerStartRequest ServerStartResponse
webdriver stop stop standalone webdriver server ServerStopRequest ServerStopResponse
webdriver open open a new browser with session id for further testing OpenSessionRequest OpenSessionResponse
webdriver close close browser session CloseSessionRequest CloseSessionResponse
webdriver call-driver call a method on web driver, i.e wb.GET(url) WebDriverCallRequest ServiceCallResponse
webdriver call-element call a method on a web element, i.e. we.Click() WebElementCallRequest WebElementCallResponse
webdriver run run set of action on a page RunRequest RunResponse
webdriver capture-start start capturing console+network (Chrome/Edge) CaptureStartRequest CaptureStartResponse
webdriver capture-stop stop capturing console+network CaptureStopRequest CaptureStopResponse
webdriver capture-status get capture counters CaptureStatusRequest CaptureStatusResponse
webdriver capture-clear clear capture buffers CaptureClearRequest CaptureClearResponse
webdriver capture-export export buffered capture data CaptureExportRequest CaptureExportResponse

call-driver and call-element actions's method and parameters are proxied to stand along webdriver server via webdriver client

See webdriver selector for more details on how to use xpath, css, id, name, class, tag, link, partial link, dom, and xpath selectors.

webdriver run request defines sequence of action/commands. In case a selector is not specified, call method's caller is a WebDriver, otherwise WebElement defined by selector. Wait provides ability to wait either some time amount or for certain condition to take place, with regexp to extract data

Run request provide commands expression for easy webdriver interaction:

Command syntax:

  [RESULT_KEY=] [(WEB_ELEMENT_SELECTOR).]METHOD_NAME(PARAMETERS)
  
  i.e:
  (#name).sendKeys('dummy 123')
  (xpath://SELECT[@id='typeId']/option[text()='type1']).click()
  get(http://127.0.0.1:8080/form.html)
  

Time wait

    - command: CurrentURL = CurrentURL()
    exit: $CurrentURL:/dummy/
    sleepTimeMs: 1000
    repeat: 10

Inline pipeline tasks

endly -r=test

@run.yaml

pipeline:
  init:
    action: webdriver:start
  test:
    action: webdriver:run
    commands:
      - get(http://play.golang.org/?simple=1)
      - (#code).clear
      - (#code).sendKeys(package main

          import "fmt"

          func main() {
              fmt.Println("Hello Endly!")
          }
        )
      - (#run).click
      - command: stdout = (.stdout).text
        exit: $stdout.Text:/Endly/
        waitTimeMs: 60000
        repeat: 10
      - close
    expect:
      stdout:
        Text: /Hello Endly!/

  defer:
    action: webdriver:stop

Capture console + network (Chrome/Edge only)

Capture uses ChromeDriver "performance" logs (CDP events) and can optionally fetch response bodies via ChromeDriver CDP endpoints. If sinkURL is provided, events are streamed as JSONL using viant/afs (for file:// it appends by default).

@capture.yaml

Navigation guard for Get(url)

webdriver:run can set navigation options to avoid hanging on pages that never finish loading. Navigation and lazy-content scrolling have independent hard limits. Every navigation returns a report with the elapsed time, final document height, scroll count, timeout state, and a stop reason such as stable-bottom, growth-limit, max-steps, or time-budget.

navigation:
  timeoutMs: 15000
  continueOnTimeout: true
  stopLoadingOnTimeout: true
  autoScrollMs: 5000
  scrollSelector: "#results-scroll-container"
  scrollDelayMs: 200
  stableWindowMs: 800
  maxScrollSteps: 15
  maxScrollGrowthPx: 20000
  maxScrollHeightPx: 60000
  idleThreshold: 0
  idleWindowMs: 500
  returnToTop: true

stopLoadingOnTimeout defaults to true and calls window.stop() before continuing, preventing an unresolved resource or streaming page from occupying the browser indefinitely. autoScrollMs: 0 disables scrolling. When enabled, scrolling runs after both successful and timed-out navigation, so normally-loaded lazy pages are handled too. Omit scrollSelector to scroll the document. A configured selector targets an inner CSS scroll container. Stability includes a last-content signature so virtualized lists are not considered stable merely because their document height is constant. autoScrollMs, maxScrollSteps, and maxScrollGrowthPx ensure an infinite feed cannot scroll forever.

Playwright-inspired commands

The original Endly commands remain supported. The following aliases offer a smaller browser-oriented DSL:

commands:
  - page.goto("https://example.test/login")
  - page.locator("#email").fill("qa@example.test")
  - page.locator("#password").fill("$testPassword")
  - page.getByTestId("submit").click()
  - createResponse = page.waitForResponse("/api/orders", 201, 10000)
  - page.locator("#status").waitForVisible(10000)
  - status = page.locator("#status").text()
  - expect(page.locator("#status")).toContainText("Signed in", 10000)
  - expect("#email").toHaveValue("qa@example.test")
  - expect(page).toHaveURL("/dashboard/", 10000)
  - expect(page).toHaveTitle("Example")
  - title = page.title()
expect:
  status: /Signed in/
  title: Example

For the default local localhost:4444 session, webdriver:run now starts ChromeDriver automatically when needed and registers idempotent context cleanup. Set autoStart: false to require explicit lifecycle tasks, or keep webdriver:start/webdriver:stop when driver deployment settings must be customized.

Every locator action auto-waits for its element and retries transient stale, intercepted, hidden, and not-interactable states. Defaults can be adjusted per run:

actionTimeoutMs: 10000
pollIntervalMs: 100
allowJavaScriptClick: false
# strictSelectors: false # optional global compatibility override

allowJavaScriptClick is deliberately opt-in. When enabled, Endly uses a DOM click only after a native click fails because of an overlay or interactability problem; stale elements are always re-resolved instead.

Playwright-style locators are strict by default: an action fails when its selector matches multiple elements. Legacy Endly commands retain their existing first-match behavior. Set strictSelectors explicitly only when a run needs to override either default.

For faster Chrome tests, use pageLoadStrategy: eager and optionally block nonessential resources with CDP URL patterns:

pageLoadStrategy: eager
blockedURLs:
  - "*://*/analytics/*"
  - "*.woff2"
  - "*.mp4"

Blocking is explicit and disabled by default because images, fonts, analytics, or media may be part of the behavior under test. blockedURLs currently requires Chrome.

Supported page commands include goto, reload, back, forward, stopLoading, title, url, tabs, switchTab, newTab, closeTab, frame, mainFrame, acceptDialog, dismissDialog, dialogText, and setDialogText.

page.waitForResponse(URLPattern, status, timeoutMs) starts bounded Chrome network capture before the run's first action and waits on observed browser traffic rather than an arbitrary sleep. The URL pattern may be a substring or /regular expression/; status 0 accepts any status. The captured transaction—including timing, headers, status, and any configured captured body—is stored under the assigned result key.

Locators include locator, getByTestId, getByText, getByLabel, getByPlaceholder, getByAltText, getByTitle, and getByRole. Locator actions include click, fill, type, press, text, inputValue, attribute, clear, submit, check, uncheck, selectOption, hover, setInputFiles, and waitForVisible.

Like Playwright, page.locator(...) treats its value as CSS unless it starts with xpath: or //. This avoids misclassifying compound CSS selectors containing spaces or attribute expressions.

Retrying locator expectations include toHaveText, toContainText, toHaveValue, toHaveAttribute, toHaveCount, toBeVisible, toBeHidden, toBeEnabled, toBeDisabled, toBeChecked, and toBeUnchecked. Page expectations include toHaveURL and toHaveTitle. Their final argument may be a timeout in milliseconds. Text comparisons normalize browser whitespace, and /regular expressions/ are accepted by equality checks. toBeHidden succeeds when the element is either absent or not displayed.

Inline expect(...) commands fail the action with expected/actual diagnostics and append a structured entry to RunResponse.assertions containing selector, method, matcher, expected value, actual value, outcome, error, and elapsed time. Both inline assertions and final expect: map validation are exposed through RunResponse.Assertion, so failures are visible to CLI and xUnit reporting instead of being nested silently in the response.

Failure evidence

Failure artifacts are opt-in because screenshots and page HTML may contain sensitive test data. When configured, action errors and final validation failures capture a screenshot, bounded page source, current URL/title, navigation reports, and optional redacted console/network history:

failureArtifacts:
  directory: file:///tmp/endly/browser-failures
  screenshot: true
  pageSource: true
  maxSourceBytes: 2000000
  includeCapture: true

The resulting RunResponse.failures entries contain the generated PNG, HTML, and JSON metadata URLs plus any capture errors. includeCapture uses the existing capture buffer, so start capture before the run when console or network evidence is required.

Attach to an existing Chrome

Endly can control tabs in a Chrome instance that was started with an authorized remote-debugging endpoint. A normally launched Chrome cannot be adopted after startup; start a dedicated browser profile with a remote-debugging port, and keep that port bound to a trusted interface.

pipeline:
  start-driver:
    action: webdriver:start
    pageLoadStrategy: eager
  attach-browser:
    action: webdriver:open
    browser: chrome
    debuggerAddress: 127.0.0.1:9222
    directCDP: true
  inspect-tabs:
    action: webdriver:run
    commands:
      - tabs = page.tabs()
      - page.switchTab("checkout")
      - currentURL = page.url()
    expect:
      currentURL: /checkout/

With directCDP: true, Endly connects directly to the Chrome debugging endpoint: ChromeDriver and Selenium Server are not required. Direct CDP supports navigation, tabs, locators, form actions, frames, dialogs, cookies, screenshots, console/network capture, assertions, and browser HTTP waits. Omit it to use ChromeDriver attachment for maximum legacy WebDriver-method compatibility.

page.switchTab accepts an exact window handle or a case-insensitive URL/title fragment. Attaching preserves the existing browser profile and tabs, but it is still browser automation and does not attempt to conceal or spoof that fact. For applications you own, use a test environment or allowlisted test identity rather than anti-detection workarounds.

Live control and activity recording

Start the interactive planner with endly -w=8082. It binds to 127.0.0.1 by default and provides:

  • cancellable one-step live execution of any page, locator, or expect command; cancellation also sends Chrome Page.stopLoading outside the WebDriver command queue so a blocked navigation can be interrupted;
  • current tabs, URL, title, capture status, and recorded activity state;
  • attachable in-page recording for an existing controlled tab;
  • live conversion of clicks, debounced input/change events, checkbox/radio changes, selects, submit, Enter/Escape presses, and navigation into the new DSL;
  • automatic plan append with pause/resume recording controls.

Password values and password value attributes are never sent back; recorded password fills use the $PASSWORD placeholder. Target and holder HTML are bounded, only the latest 1,000 recorded activities are retained, and the recorder is reinjected after navigation-triggering user actions. Activity is delivered over an authenticated local endpoint with a browser-console fallback, then deduplicated, so recording can continue when a page's content-security policy blocks cross-origin requests.

The planner generates a random recorder token, requires it on cross-origin activity events, restricts its WebSocket to same-host/loopback origins, and no longer exposes live browser control on every network interface.

Live-browser verification

The default suite remains hermetic. To run the opt-in Chrome integration flow against an already-running driver:

ENDLY_WEBDRIVER_REMOTE=http://127.0.0.1:4444/wd/hub \
go test ./service/testing/runner/webdriver -run TestLiveBrowserFlow -v

Alternatively, set only ENDLY_CHROME_DEBUGGER_ADDRESS=127.0.0.1:9222 to run the same integration flow using direct CDP without ChromeDriver. This test navigates the selected browser tab and should only be run against a disposable test profile.

Documentation

Index

Constants

View Source
const (
	PathKindUndefined = PathKind(iota)
	PathKindSimple
	PathKindComposite
)
View Source
const (
	//ServiceID represents a ServiceID
	ServiceID = "webdriver"

	//SeleniumServer represents name of selenium server
	SeleniumServer = "selenium-server-standalone"
	//GeckoDriver represents name of gecko driver
	GeckoDriver    = "geckodriver"
	ChromeDriver   = "chromedriver"
	ChromeBrowser  = "chrome"
	FirefoxBrowser = "firefox"
	Selenium       = "webdriver"
)

Variables

This section is empty.

Functions

func IsRetryableElementError added in v0.91.0

func IsRetryableElementError(err error) bool

IsRetryableElementError identifies transient DOM/layout failures that can disappear after a framework render, animation, or overlay transition.

func IsStaleElementError added in v0.73.1

func IsStaleElementError(err error) bool

func New

func New() endly.Service

New creates a new webdriver service

func NewParser

func NewParser() *parser

NewParser creates a new criteria parser

func Sessions

func Sessions(context *endly.Context) map[string]*Session

Sessions returns a point-in-time snapshot. Session objects remain live, but callers cannot race with additions/removals by mutating the backing map.

Types

type Action

type Action struct {
	Key string //optional result key
	PathKind
	Selector *WebElementSelector
	Calls    []*MethodCall
	Strict   bool
}

Action represents various calls on web element

func NewAction

func NewAction(key, selector string, method string, params ...interface{}) *Action

NewAction creates a new action

type AssertionResult added in v0.91.0

type AssertionResult struct {
	Method    string
	Selector  string
	Matcher   string
	Expected  interface{}
	Actual    interface{}
	Passed    bool
	Error     string
	ElapsedMs int
}

type CallExpectation added in v0.91.0

type CallExpectation struct {
	Matcher string
	Value   interface{}
}

type CaptureClearRequest added in v0.84.0

type CaptureClearRequest struct {
	SessionID string
}

type CaptureClearResponse added in v0.84.0

type CaptureClearResponse struct {
	SessionID string
}

type CaptureExportRequest added in v0.84.0

type CaptureExportRequest struct {
	SessionID      string
	MaxEntries     int
	IncludeConsole *bool
	IncludeNetwork *bool
}

type CaptureExportResponse added in v0.84.0

type CaptureExportResponse struct {
	SessionID string
	Summary   *CaptureSummary
	Console   []*ConsoleEntry
	Network   []*NetworkTransaction
}

type CaptureStartRequest added in v0.84.0

type CaptureStartRequest struct {
	SessionID       string
	SinkURL         string `description:"optional AFS URL for JSONL event sink (file://...)"` // proposal C
	FlushIntervalMs int    `description:"optional sink sync interval in ms (file sinks only)"`
	MaxBodyBytes    int
	MaxEntries      int `description:"maximum retained console and completed-network entries; defaults to 10000"`
	Redact          *bool
	RedactHeaders   []string
	EnableConsole   *bool
	EnableNetwork   *bool
	IncludeBodies   *bool
	URLIncludes     []string `description:"optional URL substrings; when set, capture only matching network requests"`
}

type CaptureStartResponse added in v0.84.0

type CaptureStartResponse struct {
	SessionID string
	Enabled   bool
	Warning   string
}

type CaptureState added in v0.84.0

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

func (*CaptureState) Clear added in v0.84.0

func (s *CaptureState) Clear()

func (*CaptureState) CloseSink added in v0.84.0

func (s *CaptureState) CloseSink() error

func (*CaptureState) Drain added in v0.84.0

func (s *CaptureState) Drain(sess *Session)

func (*CaptureState) Enabled added in v0.91.0

func (s *CaptureState) Enabled() bool

func (*CaptureState) FlushSink added in v0.84.0

func (s *CaptureState) FlushSink() error

func (*CaptureState) Snapshot added in v0.84.0

func (s *CaptureState) Snapshot(maxEntries int, includeConsole, includeNetwork bool) (console []*ConsoleEntry, network []*NetworkTransaction)

func (*CaptureState) StartSink added in v0.84.0

func (s *CaptureState) StartSink(fs afs.Service, sinkURL string, flushIntervalMs int) error

func (*CaptureState) Stop added in v0.91.0

func (s *CaptureState) Stop()

func (*CaptureState) Summary added in v0.84.0

func (s *CaptureState) Summary() *CaptureSummary

type CaptureStatusRequest added in v0.84.0

type CaptureStatusRequest struct {
	SessionID string
}

type CaptureStatusResponse added in v0.84.0

type CaptureStatusResponse struct {
	SessionID string
	Summary   *CaptureSummary
}

type CaptureStopRequest added in v0.84.0

type CaptureStopRequest struct {
	SessionID string
}

type CaptureStopResponse added in v0.84.0

type CaptureStopResponse struct {
	SessionID string
	Summary   *CaptureSummary
}

type CaptureSummary added in v0.84.0

type CaptureSummary struct {
	Enabled           bool
	StartedAt         time.Time
	RequestsInFlight  int
	RequestsCompleted int
	ConsoleEntries    int
	Errors            []string
}

type CapturedBody added in v0.84.0

type CapturedBody struct {
	Encoding  string
	Data      string
	Truncated bool
}

type CloseSessionRequest

type CloseSessionRequest struct {
	SessionID string
}

CloseSessionRequest represents close session request.

func NewCloseSessionRequestFromURL

func NewCloseSessionRequestFromURL(URL string) (*CloseSessionRequest, error)

NewCloseSessionRequestFromURL creates a new close session request from URL

type CloseSessionResponse

type CloseSessionResponse struct {
	SessionID string
}

CloseSessionResponse represents close session response.

type ConsoleEntry added in v0.84.0

type ConsoleEntry struct {
	Timestamp time.Time
	Level     string
	Message   string
}

type FailureArtifact added in v0.91.0

type FailureArtifact struct {
	Timestamp     time.Time
	Error         string
	Method        string
	Selector      string
	URL           string
	Title         string
	ScreenshotURL string
	PageSourceURL string
	MetadataURL   string
	Capture       *CaptureSummary
	CaptureErrors []string
}

type FailureArtifactOptions added in v0.91.0

type FailureArtifactOptions struct {
	Directory      string `description:"AFS URL or local directory for failure evidence; required when enabled"`
	Screenshot     *bool  `description:"capture a PNG screenshot; defaults to true"`
	PageSource     *bool  `description:"capture current page HTML; defaults to true"`
	IncludeCapture bool   `description:"include buffered console and network capture in metadata"`
	MaxSourceBytes int    `description:"maximum page-source bytes; defaults to 2000000"`
}

type MethodCall

type MethodCall struct {
	Wait
	Method       string
	Parameters   []interface{}
	AllowMissing bool `yaml:"-" json:"-"`
}

MethodCall represents selenium call.

type NavigationOptions struct {
	TimeoutMs            int    `description:"page load timeout for Get(url); on timeout it warns and continues"`
	ContinueOnTimeout    *bool  `description:"continue after a page-load timeout; defaults to true"`
	StopLoadingOnTimeout *bool  `description:"call window.stop after a page-load timeout; defaults to true"`
	AutoScrollMs         int    `description:"hard time budget for bounded lazy-content scrolling; zero disables scrolling"`
	ScrollSelector       string `description:"optional CSS selector for a scroll container; defaults to the document"`
	ScrollDelayMs        int    `description:"delay between scroll steps"`
	StableWindowMs       int    `description:"stop autoscroll after height and position remain stable at the bottom"`
	MaxScrollSteps       int    `description:"hard limit on scroll steps"`
	MaxScrollGrowthPx    int    `description:"hard limit on document-height growth; protects against infinite feeds"`
	MaxScrollHeightPx    int    `description:"optional absolute document-height limit"`
	ReturnToTop          bool   `description:"return to the top after lazy-content scrolling"`
	IdleThreshold        int    `description:"network idle threshold (inflight requests <= threshold)"`
	IdleWindowMs         int    `description:"consider network idle only if threshold holds for this long"`
	IdleMaxWaitMs        int    `description:"optional smaller network-idle budget; never extends AutoScrollMs"`
}
type NavigationReport struct {
	URL            string
	TimedOut       bool
	Scrolled       bool
	Steps          int
	StartHeightPx  int
	FinalHeightPx  int
	ElapsedMs      int
	StopReason     string
	ScrollTarget   string
	LoadingStopped bool
	Warning        string
}

NavigationReport explains how navigation stabilization stopped. It makes infinite-feed and slow-page behavior observable instead of silently hiding it.

type NetworkTransaction added in v0.84.0

type NetworkTransaction struct {
	RequestID string
	Sequence  int

	URL    string
	Method string

	RequestHeaders  map[string]any
	RequestBody     *CapturedBody
	ResourceType    string
	Initiator       map[string]any
	StartTimestamp  float64
	EndTimestamp    float64
	DurationMs      int64
	ErrorText       string
	WasCanceled     bool
	EncodedDataSize int64

	Status          int
	StatusText      string
	MimeType        string
	ResponseHeaders map[string]any
	ResponseBody    *CapturedBody
}

type OpenSessionRequest

type OpenSessionRequest struct {
	Browser          string
	Capabilities     []string
	Remote           string   `description:"webdriver server endpoint"`
	SessionID        string   `description:"if specified this SessionID will be used for a sessionID"`
	DebuggerAddress  string   `description:"optional host:port of an existing Chrome started with remote debugging enabled"`
	DirectCDP        bool     `description:"connect directly to a debug-enabled Chrome without ChromeDriver"`
	PageLoadStrategy string   `description:"browser navigation strategy: normal, eager, or none"`
	BlockedURLs      []string `description:"optional Chrome URL patterns blocked through CDP"`
}

OpenSessionRequest represents open session request

func NewOpenSessionRequest

func NewOpenSessionRequest(browser string, remote string) *OpenSessionRequest

NewOpenSessionRequest creates a new open session request

func (*OpenSessionRequest) Init

func (r *OpenSessionRequest) Init() error

Init initializes request

type OpenSessionResponse

type OpenSessionResponse struct {
	SessionID string
	Attached  bool
	Backend   string
}

OpenSessionResponse represents open session response.

type PathKind added in v0.73.0

type PathKind int

type RunRequest

type RunRequest struct {
	SessionID            string
	Browser              string
	RemoteSelenium       string             //remote selenium resource
	DebuggerAddress      string             `description:"optional host:port of an existing Chrome started with remote debugging enabled"`
	DirectCDP            bool               `description:"connect directly to a debug-enabled Chrome without ChromeDriver"`
	PageLoadStrategy     string             `description:"browser navigation strategy: normal, eager, or none"`
	BlockedURLs          []string           `description:"optional Chrome URL patterns blocked through CDP to reduce test noise and load"`
	AutoStart            *bool              `description:"automatically start a local driver for the default session; defaults to true"`
	Navigation           *NavigationOptions `description:"optional Get(url) navigation guard options"`
	Actions              []*Action
	ActionTimeoutMs      int                     `description:"default total deadline for each locator action; defaults to 10000ms"`
	PollIntervalMs       int                     `description:"default polling interval for locator actions; defaults to 100ms"`
	AllowJavaScriptClick bool                    `description:"opt-in fallback to DOM click after a native click is intercepted or not interactable"`
	StrictSelectors      *bool                   `description:"override locator strictness; Playwright-style locators are strict by default"`
	FailureArtifacts     *FailureArtifactOptions `description:"optional screenshot, page-source, and browser-capture evidence written when the run fails"`
	ActionDelaysMs       int                     `description:"slows down action with specified delay"`
	Commands             []interface{}           `` /* 130-byte string literal not displayed */
	Expect               interface{}             `description:"If specified it will validated response as actual"`
}

RunRequest represents group of selenium web elements calls

func NewRunRequest

func NewRunRequest(sessionID, browser string, remote string, actions ...*Action) *RunRequest

NewRunRequest creates a new run request

func NewRunRequestFromURL

func NewRunRequestFromURL(URL string) (*RunRequest, error)

NewRunRequestFromURL creates a new request from URL

func (*RunRequest) Init

func (r *RunRequest) Init() error

func (*RunRequest) IsInput

func (r *RunRequest) IsInput() bool

IsInput returns this request (CLI reporter interface)

func (*RunRequest) Messages

func (r *RunRequest) Messages() []*msg.Message

IsInput returns this request (CLI reporter interface)

func (*RunRequest) Validate

func (r *RunRequest) Validate() error

Validate validates run request.

type RunResponse

type RunResponse struct {
	SessionID    string
	Backend      string
	Data         map[string]interface{}
	LookupErrors []string
	Navigations  []*NavigationReport
	Failures     []*FailureArtifact
	Assertions   []*AssertionResult
	Assert       *validator.AssertResponse
}

RunResponse represents selenium call response

func (*RunResponse) Assertion added in v0.91.0

func (r *RunResponse) Assertion() []*assertly.Validation

Assertion exposes webdriver validation to the CLI/xUnit reporting pipeline.

func (*RunResponse) IsOutput

func (r *RunResponse) IsOutput() bool

IsOutput returns this response (CLI reporter interface)

func (*RunResponse) Messages

func (r *RunResponse) Messages() []*msg.Message

Messages returns messages

type ServiceCallResponse

type ServiceCallResponse struct {
	Result []interface{}
	Data   data.Map
}

ServiceCallResponse represents selenium call response

type Session

type Session struct {
	SessionID       string
	Browser         string
	Pid             int
	Server          string
	Remote          string
	CDPRemote       string
	DriverSessionID string
	Capture         *CaptureState
	Net             *netTracker

	Capabilities     []string
	PageLoadStrategy string
	Attached         bool
	Backend          string
	// contains filtered or unexported fields
}

Session represents a selenium session

func (*Session) Close

func (s *Session) Close()

func (*Session) Driver added in v0.74.0

func (s *Session) Driver() selenium.WebDriver

type StartRequest

type StartRequest struct {
	Target       *location.Resource
	URL          string
	BaseLocation string
	Driver       string
	Server       string
	Sdk          string
	Capabilities []string
	// PageLoadStrategy controls how long WebDriver waits for navigation. Use
	// eager for development servers that intentionally keep a live connection.
	PageLoadStrategy string
	Port             int
}

StartRequest represents a selenium server start request

func NewStartRequestFromURL

func NewStartRequestFromURL(URL string) (*StartRequest, error)

NewStartRequestFromURL creates a new start request from URL

func (*StartRequest) Init

func (r *StartRequest) Init() error

func (*StartRequest) Validate

func (r *StartRequest) Validate() error

type StartResponse

type StartResponse struct {
	Pid        int
	ServerPath string
	DriverPath string
	SessionID  string
}

StartResponse represents a selenium server stop request

type StopLoadingRequest added in v0.91.0

type StopLoadingRequest struct {
	SessionID string
}

type StopLoadingResponse added in v0.91.0

type StopLoadingResponse struct {
	SessionID string
	Stopped   bool
}

type StopRequest

type StopRequest struct {
	Target *location.Resource
	URL    string
	Port   int
}

StopRequest represents server stop request

func NewStopRequestFromURL

func NewStopRequestFromURL(URL string) (*StopRequest, error)

NewStopRequestFromURL creates a new start request from URL

func (*StopRequest) Init

func (r *StopRequest) Init() error

type StopResponse

type StopResponse struct {
}

StopResponse represents a selenium stop request

type Wait

type Wait struct {
	WaitTimeMs     int
	PollIntervalMs int `description:"poll interval for wait conditions; defaults to 100ms"`
	ThinkTimeMs    int
	IgnoreTimeout  bool
	Exit           string
	Expectation    *CallExpectation `yaml:"-" json:"-"`
	// contains filtered or unexported fields
}

type WebDriverCallRequest

type WebDriverCallRequest struct {
	SessionID string
	Key       string
	PathKind  PathKind
	Call      *MethodCall
	// contains filtered or unexported fields
}

WebDriverCallRequest represents selenium call driver request

type WebElementCallRequest

type WebElementCallRequest struct {
	SessionID            string
	Selector             *WebElementSelector
	Call                 *MethodCall
	PathKind             PathKind
	AllowJavaScriptClick bool
	Strict               bool
	// contains filtered or unexported fields
}

WebElementCallRequest represents a web element call reqesut

type WebElementCallResponse

type WebElementCallResponse struct {
	Result      []interface{}
	LookupError string
	Data        map[string]interface{}
}

WebElementCallResponse represents seleniun web element response

type WebElementSelector

type WebElementSelector struct {
	By    string //selector type
	Value string //selector value
	Key   string //optional result key
}

WebElementSelector represents a web element selector

func NewWebElementSelector

func NewWebElementSelector(by, value string) *WebElementSelector

NewWebElementSelector creates a new instance of web element selector

func (*WebElementSelector) Init

func (s *WebElementSelector) Init() error

Validate checks is selector is valid.

func (*WebElementSelector) Validate

func (s *WebElementSelector) Validate() error

Validate checks is selector is valid.

type WebSelector

type WebSelector string

func (WebSelector) ByAndValue

func (s WebSelector) ByAndValue() (by, value string)

Directories

Path Synopsis
extension

Jump to

Keyboard shortcuts

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