WebContext
The web evaluatioin context.
Attributes
- Graph
-
- Supertypes
-
trait WebSessionEventListenerclass EvalContexttrait PdfSupporttrait SysProcSupporttrait SimilaritySupporttrait TemplateSupporttrait DecodingSupporttrait ScriptSupporttrait SQLSupporttrait JsonPathSupporttrait XPathSupporttrait RegexSupportclass Environmenttrait LazyLoggingclass Objecttrait Matchableclass AnyShow all
Members list
Value members
Concrete methods
Add a list of error attachments to the given step including the current screenshot and all current error attachments.
Add a list of error attachments to the given step including the current screenshot and all current error attachments.
Value parameters
- failure
-
the failed status
Attributes
- Definition Classes
-
EvalContext
Binds the given element and value to a given action (element/action=value) and then waits for any bound post conditions to be satisfied.
Binds the given element and value to a given action (element/action=value) and then waits for any bound post conditions to be satisfied.
Value parameters
- action
-
the action to bind the value to
- element
-
the element to bind the value to
- value
-
the value to bind
Attributes
Captures an element screenshot and adds it to the attachments list.
Captures an element screenshot and adds it to the attachments list.
Attributes
Captures the current screenshot and adds it to the attachments list.
Captures the current screenshot and adds it to the attachments list.
Attributes
Checks the current state of an element.
Checks the current state of an element.
Value parameters
- binding
-
the locator binding of the element
- message
-
optional assertion error message
- mode
-
the assertion mode
- negate
-
whether or not to negate the check
- state
-
the state to check
Attributes
Closes the context and all browsers and associated web drivers (if any have loaded).
Closes the context and all browsers and associated web drivers (if any have loaded).
Attributes
- Definition Classes
-
Environment
Closes a named browser and associated web driver.
Closes a named browser and associated web driver.
Attributes
Closes the last child window.
Closes the last child window.
Attributes
Closes the tab or window occurrence.
Closes the tab or window occurrence.
Value parameters
- occurrence
-
the tag or window occurrence to close (primary is 0, first opened is occurrence 1, 2nd is 2, ..)
Attributes
Gets the actual value of an attribute and compares it with an expected value or condition.
Gets the actual value of an attribute and compares it with an expected value or condition.
Value parameters
- actual
-
the actual value of the element
- expected
-
the expected value, regex, xpath, or json path
- message
-
optional error message to use
- mode
-
the assertion mode
- name
-
the name of the attribute being compared
- nameSuffix
-
optional name suffix
- negate
-
true to negate the result
- operator
-
the comparison operator
- timeoutSecs
-
the number of seconds to wait before timing out
Attributes
- Returns
-
true if the actual value matches the expected value
Deselects a value in a dropdown (select control) by index.
Deselects a value in a dropdown (select control) by index.
Value parameters
- binding
-
the locator binding
- index
-
the index to select (first index is 0)
Attributes
Deselects a value in a dropdown (select control) by value.
Deselects a value in a dropdown (select control) by value.
Value parameters
- binding
-
the locator binding
- value
-
the value to select
Attributes
Deselects a value in a dropdown (select control) by visible text.
Deselects a value in a dropdown (select control) by visible text.
Value parameters
- binding
-
the locator binding
- value
-
the value to select
Attributes
Adds web engine dsl steps to super implementation. The entries returned by this method are used for tab completion in the REPL.
Adds web engine dsl steps to super implementation. The entries returned by this method are used for tab completion in the REPL.
Attributes
- Definition Classes
-
EvalContext
Executes a javascript expression on the current page through the web driver.
Executes a javascript expression on the current page through the web driver.
Value parameters
- javascript
-
the script expression to execute
- params
-
optional parameters to the script
Attributes
- Definition Classes
-
ScriptSupport
Injects and executes a javascript on the current page through web driver.
Injects and executes a javascript on the current page through web driver.
Value parameters
- javascript
-
the script expression to execute
- params
-
optional parameters to the script
- takeScreenShot
-
true to take screenshot after performing the function
Attributes
Appends a return keyword in front of the given javascript expression in preparation for execute-with-return (since web driver requires return prefix).
Appends a return keyword in front of the given javascript expression in preparation for execute-with-return (since web driver requires return prefix).
Value parameters
- javascript
-
the javascript function
Attributes
- Definition Classes
-
ScriptSupport
Resolves a bound attribute value from the visible scope.
Resolves a bound attribute value from the visible scope.
Value parameters
- name
-
the name of the bound attribute to find
Attributes
Gets a bound value from memory. A search for the value is made in the following order and the first value found is returned:
Gets a bound value from memory. A search for the value is made in the following order and the first value found is returned:
- Web element text on the current page
- Currently active page scope
- The top scope
- Settings
Value parameters
- name
-
the name of the bound value to find
Attributes
- Definition Classes
-
EvalContext
Gets a cached web element.
Gets a cached web element.
Value parameters
- element
-
the name of the web element
Attributes
- Returns
-
the cached web element
Gets an element's selected value(s).
Gets an element's selected value(s).
Value parameters
- name
-
the name of the element
- selection
-
textto get selected option text,valueto get selected option value
Attributes
- Returns
-
the selected value or a comma seprated string containing all the selected values if multiple values are selected.
Gets the text value of a web element on the current page. A search for the text is made in the following order and the first value found is returned:
Gets the text value of a web element on the current page. A search for the text is made in the following order and the first value found is returned:
- Web element text
- Web element text attribute
- Web element value attribute If a value is found, its value is bound to the current page scope as
name/text.
Value parameters
- binding
-
the locator binding
Attributes
Gets a named locator binding.
Gets a named locator binding.
Value parameters
- name
-
the name of the web element
Attributes
Gets a named locator binding.
Gets a named locator binding.
Value parameters
- name
-
the name of the web element
- optional
-
true to return None if not found; false to throw error
Attributes
Gets the message of an alert of confirmation popup.
Gets the message of an alert of confirmation popup.
Attributes
- Returns
-
the alert or confirmation message
Gets the title of the current page in the browser.
Gets the title of the current page in the browser.
Attributes
Handles an alert (pop-up)
Handles an alert (pop-up)
Value parameters
- accept
-
true to accept; false to dismiss
Attributes
Highlights and then un-highlights a browser element. Uses pure javascript, as suggested by https://github.com/alp82. The duration of the highlight lasts for gwen.web.throttle.msecs. The look and feel of the highlight is controlled by the gwen.web.highlight.style setting.
Highlights and then un-highlights a browser element. Uses pure javascript, as suggested by https://github.com/alp82. The duration of the highlight lasts for gwen.web.throttle.msecs. The look and feel of the highlight is controlled by the gwen.web.highlight.style setting.
Value parameters
- element
-
the element to highlight
Attributes
Checks if an element is displayed.
Checks if an element is displayed.
Attributes
Checks the current state of an element.
Checks the current state of an element.
Value parameters
- binding
-
the locator binding of the element
- negate
-
whether or not to negate the check
- state
-
the state to check
Attributes
Locates a web element and highlights it.
Locates a web element and highlights it.
Value parameters
- binding
-
the locator binding
Attributes
Maximizes the browser window.
Maximizes the browser window.
Attributes
Navigates the browser the given URL
Navigates the browser the given URL
Value parameters
- url
-
the URL to navigate to
Attributes
Starts a new session if there isn't one or stays in the current one.
Starts a new session if there isn't one or stays in the current one.
Attributes
Gets the number of open sesions.
Gets the number of open sesions.
Attributes
Gets the number of open windows.
Gets the number of open windows.
Attributes
Performs and action on a web element in the context of another element.
Performs and action on a web element in the context of another element.
Value parameters
- action
-
description of the action
- context
-
the name of the context element binding to find the element in
- element
-
the name of the element to perform the action on
Attributes
Refreshes the current page.
Refreshes the current page.
Attributes
Resets the driver context.
Resets the driver context.
Attributes
Resets the context for the given state level.
Resets the context for the given state level.
Attributes
- Definition Classes
-
Environment
Resizes the browser window to the given dimensions.
Resizes the browser window to the given dimensions.
Value parameters
- height
-
the height
- width
-
the width
Attributes
Scrolls an element into view.
Scrolls an element into view.
Value parameters
- binding
-
the locator binding
- scrollTo
-
scroll element into view, options are: top or bottom
Attributes
Scrolls the given web element into view.
Scrolls the given web element into view.
Value parameters
- offset
-
offset to scroll by (default is zero)
- scrollTo
-
scroll element into view, options are: top or bottom
- webElement
-
the web element to scroll to
Attributes
Scrolls to the top of bottom of the current page.
Scrolls to the top of bottom of the current page.
Value parameters
- scrollTo
-
top or bottom
Attributes
Selects a value in a dropdown (select control) by index.
Selects a value in a dropdown (select control) by index.
Value parameters
- binding
-
the locator binding
- index
-
the index to select (first index is 0)
Attributes
Selects a value in a dropdown (select control) by value.
Selects a value in a dropdown (select control) by value.
Value parameters
- binding
-
the locator binding
- value
-
the value to select
Attributes
Selects a value in a dropdown (select control) by visible text.
Selects a value in a dropdown (select control) by visible text.
Value parameters
- binding
-
the locator binding
- value
-
the value to select
Attributes
Sends a value to a web element.
Sends a value to a web element.
Value parameters
- binding
-
the locator binding
- clearFirst
-
true to clear field first (if element is a text field)
- clickFirst
-
true to click field first (if element is a text field)
- sendEnterKey
-
true to send the Enter key after sending the value
- value
-
the value to send
Attributes
Attributes
- Definition Classes
Switches to the first child window if one was just opened.
Switches to the first child window if one was just opened.
Attributes
Switches to the top window / first frame
Switches to the top window / first frame
Attributes
Starts and switches to a new tab or window.
Starts and switches to a new tab or window.
Value parameters
- winType
-
tab or window
Attributes
Switches to the parent window.
Switches to the parent window.
Attributes
Switches the web driver session
Switches the web driver session
Value parameters
- session
-
the name of the session to switch to
Attributes
Switches to a tab or window occurrence.
Switches to a tab or window occurrence.
Value parameters
- occurrence
-
the tag or window occurrence to switch to (primary is 0, first opened is occurrence 1, 2nd is 2, ..)
Attributes
Waits the state of an element.
Waits the state of an element.
Value parameters
- binding
-
the locator binding of the element
- negate
-
whether or not to negate the check
- state
-
the state to wait for
Attributes
Waits for text to appear in the given web element.
Waits for text to appear in the given web element.
Value parameters
- binding
-
the locator binding
Attributes
Waits for a given condition to be true. Errors on time out after "gwen.web.wait.seconds" (default is 10 seconds)
Waits for a given condition to be true. Errors on time out after "gwen.web.wait.seconds" (default is 10 seconds)
Value parameters
- condition
-
the boolean condition to wait for (until true)
- reason
-
a description of what is being waited on
Attributes
Waits until a given condition is ready for an optional number of seconds. Errors on given timeout out seconds.
Waits until a given condition is ready for an optional number of seconds. Errors on given timeout out seconds.
Value parameters
- condition
-
the boolean condition to wait for (until true)
- reason
-
a description of what is being waited on
- timeoutSecs
-
optional number of seconds to wait before timing out
Attributes
Waits until a given condition is ready for a given number of seconds. Errors on given timeout out seconds.
Waits until a given condition is ready for a given number of seconds. Errors on given timeout out seconds.
Value parameters
- condition
-
the boolean condition to wait for (until true)
- reason
-
a description of what is being waited on
- timeoutSecs
-
the number of seconds to wait before timing out
Attributes
- Definition Classes
-
EvalContext
Waits until a given condition is ready for a given number of seconds using a given polling delay. Errors on given timeout out seconds.
Waits until a given condition is ready for a given number of seconds using a given polling delay. Errors on given timeout out seconds.
Value parameters
- condition
-
the boolean condition to wait for (until true)
- delayMsecs
-
the polling delay (milliseconds)
- reason
-
a description of what is being waited on
- timeoutSecs
-
the number of seconds to wait before timing out
Attributes
Invokes a function that performs an operation on the current web driver session and conditionally captures the current screenshot if the specified takeScreenShot is true.
Invokes a function that performs an operation on the current web driver session and conditionally captures the current screenshot if the specified takeScreenShot is true.
Value parameters
- function
-
the function to perform
- takeScreenShot
-
true to take screenshot after performing the function
Attributes
Inherited methods
Attributes
- Inherited from:
- Environment
Adds current behavior.
Adds current behavior.
Attributes
- Inherited from:
- Environment
Gets a named data scope (creates it if it does not exist)
Gets a named data scope (creates it if it does not exist)
Value parameters
- name
-
the name of the data scope to get (or create and get)
Attributes
- Inherited from:
- Environment
Adds a step definition to the context.
Adds a step definition to the context.
Value parameters
- name
-
the name
- stepDef
-
the step definition to add
Attributes
- Inherited from:
- Environment
Adds a step definition to the context.
Adds a step definition to the context.
Value parameters
- stepDef
-
the step definition to add
Attributes
- Inherited from:
- Environment
Attributes
- Inherited from:
- Environment
Attributes
- Inherited from:
- Environment
Attributes
- Inherited from:
- EvalContext
Attributes
- Inherited from:
- SysProcSupport
Attributes
- Inherited from:
- PdfSupport
Attributes
- Inherited from:
- EvalContext
Create a clone of the current environment state
Create a clone of the current environment state
Attributes
- Inherited from:
- Environment
Attributes
- Inherited from:
- EvalContext
Gets the current behavior.
Gets the current behavior.
Attributes
- Inherited from:
- Environment
Attributes
- Inherited from:
- EvalContext
Decodes a base 64 encoded string.
Decodes a base 64 encoded string.
Value parameters
- source
-
the encoded source string
Attributes
- Returns
-
the decoded result string
- Inherited from:
- DecodingSupport
Compares two strings for similarity and returns a percentage score.
Compares two strings for similarity and returns a percentage score.
Value parameters
- value1
-
string 1
- value2
-
string 2
Attributes
- Returns
-
the DSC similarity score (if it could be calculated), otherwise None
- Inherited from:
- SimilaritySupport
Evaluates an function or returns the given dry value depending on--dry-run mode.
Evaluates an function or returns the given dry value depending on--dry-run mode.
Value parameters
- dryValue
-
the dry value
- function
-
the function to evaluate
Attributes
- Inherited from:
- EvalContext
Evaluates an json path expression against a JSON source string and returns the result.
Evaluates an json path expression against a JSON source string and returns the result.
Value parameters
- jsonpath
-
the json path expression
- source
-
the json source string
Attributes
- Returns
-
the result of evaluating the json path expression
- Inherited from:
- JsonPathSupport
Evaluates an xpath expression against an xml source string and returns the result.
Evaluates an xpath expression against an xml source string and returns the result.
Value parameters
- source
-
the xml source string
- targetType
-
the target node type
- xpath
-
the expath expression
Attributes
- Returns
-
the result of evaluating the xpath expression
- Inherited from:
- XPathSupport
Evaluates an SQL query against a database and returns the first column value of the first row in the result.
Evaluates an SQL query against a database and returns the first column value of the first row in the result.
Value parameters
- database
-
the database name
- sql
-
the SQL statement to execute
Attributes
- Returns
-
the first column value of the first row in the result
- Inherited from:
- SQLSupport
Executes an SQL update statement against a database and returns the number of rows affected.
Executes an SQL update statement against a database and returns the number of rows affected.
Value parameters
- database
-
the database name
- sql
-
the SQL update statement to execute
Attributes
- Returns
-
the number of rows affected (as a string)
- Inherited from:
- SQLSupport
Extracts a substring from a source string by regex. The value in the first matching regex group is returned, otherwise an error is thrown.
Extracts a substring from a source string by regex. The value in the first matching regex group is returned, otherwise an error is thrown.
Value parameters
- regex
-
the regex extractor pattern
- source
-
the source string
Attributes
- Returns
-
the extracted value
- Inherited from:
- RegexSupport
Filters all attributes in all scopes based on the given predicate.
Filters all attributes in all scopes based on the given predicate.
Value parameters
- pred
-
the predicate filter to apply; a (name, value) => boolean function
Attributes
- Returns
-
a new Scoped data stack containing only the attributes accepted by the predicate;
- Inherited from:
- Environment
Gets a named binding
Gets a named binding
Value parameters
- name
-
the binding name
Attributes
- Returns
-
a binding
- Inherited from:
- EvalContext
Gets the paraterised step definition for the given expression.
Gets the paraterised step definition for the given expression.
Value parameters
- docString
-
optional step docString (parameter)
- expression
-
the step expression to get the step definition for
Attributes
- Returns
-
the step definition and its parameters (name value tuples) if a match is found; None otherwise
- Inherited from:
- Environment
Attributes
- Inherited from:
- Environment
Interpolates a given string by resolving all $ and ${property} references.
Interpolates a given string by resolving all $ and ${property} references.
Value parameters
- source
-
the string to interpolate
Attributes
- Inherited from:
- EvalContext
Interpolates a given string by resolving all $ and ${property} references.
Interpolates a given string by resolving all $ and ${property} references.
Value parameters
- source
-
the string to interpolate
Attributes
- Inherited from:
- EvalContext
Interpolates a given string by resolving all $ references only.
Interpolates a given string by resolving all $ references only.
Value parameters
- source
-
the string to interpolate
Attributes
- Inherited from:
- EvalContext
Checks if a top level step is currently being evaluated).
Checks if a top level step is currently being evaluated).
Attributes
- Inherited from:
- Environment
Matches a template against a given source and extracts, ignores, or injects values.
Matches a template against a given source and extracts, ignores, or injects values.
Value parameters
- source
-
the source string
- sourceName
-
the name of the source attribute
- template
-
the template string
Attributes
- Returns
-
success if there is a match; an error otherwise
- Inherited from:
- TemplateSupport
Attributes
- Inherited from:
- Environment
Attributes
- Inherited from:
- Environment
Attributes
- Inherited from:
- EvalContext
Performs an operation only if --dry-run mode is off.
Performs an operation only if --dry-run mode is off.
Value parameters
- operation
-
the operation to execute
Attributes
- Inherited from:
- EvalContext
Attributes
- Inherited from:
- Environment
Removes the current behavior.
Removes the current behavior.
Attributes
- Inherited from:
- Environment
Pops a node off the node chain.
Pops a node off the node chain.
Attributes
- Inherited from:
- Environment
Pushes a node onto the node chain.
Pushes a node onto the node chain.
Attributes
- Inherited from:
- Environment
Removes (unloads) the stepdef with the given name
Removes (unloads) the stepdef with the given name
Value parameters
- name
-
the step def name
Attributes
- Returns
-
the removed step def
- Inherited from:
- Environment
Attributes
- Inherited from:
- Environment
Attributes
- Inherited from:
- WebSessionEventListener
The spec type currently being evaluated.
The spec type currently being evaluated.
Attributes
- Inherited from:
- Environment
Attributes
- Inherited from:
- Environment
Attributes
- Inherited from:
- Environment
Attributes
- Inherited from:
- Environment
Returns the current visible scopes.
Returns the current visible scopes.
Attributes
- Inherited from:
- Environment
Applies a function to a step and captures the result.
Applies a function to a step and captures the result.
Value parameters
- step
-
the step to evaluate
- stepFunction
-
the step evaluator function
Attributes
- Inherited from:
- EvalContext
Inherited fields
Attributes
- Inherited from:
- LazyLogging