This class supports switching to the currently active element in ScalaTest's Selenium DSL.
This class supports switching to the alert box in ScalaTest's Selenium DSL.
This class is part of ScalaTest's Selenium DSL.
A class name query.
This class is part of the ScalaTest's Selenium DSL.
A CSS selector query.
This class supports switching to the default content in ScalaTest's Selenium DSL.
A dimension containing the width and height of a screen element.
Wrapper class for a Selenium WebElement
.
This class supports switching to a frame by element in ScalaTest's Selenium DSL.
This class supports switching to a frame by index in ScalaTest's Selenium DSL.
This class supports switching to a frame by name or ID in ScalaTest's Selenium DSL.
This class supports switching to a frame by web element in ScalaTest's Selenium DSL.
An ID query.
A link text query.
This class is part of ScalaTest's Selenium DSL.
This class is part of ScalaTest's Selenium DSL.
A name query.
Trait that facilitates using the page object pattern with the ScalaTest Selenium DSL.
A partial link text query.
A point containing an XY screen location.
This trait is part of ScalaTest's Selenium DSL.
This class is part of ScalaTest's Selenium DSL.
This class is part of ScalaTest's Selenium DSL.
This class is part of ScalaTest's Selenium DSL.
This sealed abstract class supports switching in ScalaTest's Selenium DSL.
A tag name query.
This class is part of ScalaTest's Selenium DSL.
This class is part of ScalaTest's Selenium DSL.
This class supports switching to a window by name or handle in ScalaTest's Selenium DSL.
Wrapper class for a Selenium Cookie
.
An XPath query.
This value supports switching to the currently active element in ScalaTest's Selenium DSL.
This value supports switching to the currently active element in ScalaTest's Selenium DSL.
Please see the documentation for WebBrowser
for an overview of the Selenium DSL.
This class is enables the following syntax:
switch to activeElement ^
This object is part of ScalaTest's Selenium DSL.
Add cookie in the web browser.
Add cookie in the web browser. If the cookie's domain name is left blank (default), it is assumed that the cookie is meant for the domain of the current document.
cookie's name
cookie's value
cookie's path
cookie's expiry data
cookie's domain name
whether this cookie is secured.
the WebDriver
with which to drive the browser
This value supports switching to the alert box in ScalaTest's Selenium DSL.
This value supports switching to the alert box in ScalaTest's Selenium DSL.
Please see the documentation for WebBrowser
for an overview of the Selenium DSL.
This class is enables the following syntax:
switch to alert ^
This object is part of ScalaTest's Selenium DSL.
Captures a screenshot and saves it as a file in the specified directory.
Captures a screenshot and saves it as a file in the specified directory.
Capture screenshot and save it as the specified name (if file name does not end with .
Capture screenshot and save it as the specified name (if file name does not end with .png, it will be extended automatically) in capture directory,
which by default is system property's java.io.tmpdir. You can change capture directory by calling setCaptureDir
screenshot file name, if does not end with .png, it will be extended automatically
Finds and returns the first Checkbox
selected by the specified string ID or name, throws TestFailedException
if element not found or the found element is not a Checkbox
.
Finds and returns the first Checkbox
selected by the specified string ID or name, throws TestFailedException
if element not found or the found element is not a Checkbox
.
the string with which to search, first by ID then by name
the WebDriver
with which to drive the browser
the Checkbox
selected by this query
Finds and returns the first Checkbox
selected by the specified Query
, throws TestFailedException
if element not found or the found element is not a Checkbox
.
Finds and returns the first Checkbox
selected by the specified Query
, throws TestFailedException
if element not found or the found element is not a Checkbox
.
the Query
with which to search
the WebDriver
with which to drive the browser
the Checkbox
selected by this query
Returns a class name query.
Returns a class name query.
This method enables syntax such as the following:
click on className("???")
^
This object is part of ScalaTest's Selenium DSL.
Click on the specified Element
Click on the first Element
selected by the specified string ID or name
Click on the first Element
selected by the specified string ID or name
the string with which to search, first by ID then by name
the WebDriver
with which to drive the browser
Click on the first Element
selected by the specified Query
Click on the first Element
selected by the specified Query
the Query
with which to search
the WebDriver
with which to drive the browser
Click on the specified WebElement
Closes the current browser window, and exits the driver if the current window was the only one remaining.
Closes the current browser window, and exits the driver if the current window was the only one remaining.
the WebDriver
with which to drive the browser
Get a saved cookie from web browser, throws TestFailedException if the cookie does not exist.
Get a saved cookie from web browser, throws TestFailedException if the cookie does not exist.
cookie's name
a WrappedCookie instance
This field supports cookie deletion in ScalaTest's Selenium DSL.
This field supports cookie deletion in ScalaTest's Selenium DSL. Please see the documentation for
WebBrowser
for an overview of the Selenium DSL.
This field enables the following syntax:
delete all cookies ^
Returns a CSS selector query.
Returns a CSS selector query.
This method enables syntax such as the following:
click on cssSelector("???")
^
Returns the URL of the current page.
Returns the URL of the current page.
This method invokes getCurrentUrl
on the passed WebDriver
and returns the result.
the WebDriver
with which to drive the browser
the URL of the current page
This value supports switching to the default content in ScalaTest's Selenium DSL.
This value supports switching to the default content in ScalaTest's Selenium DSL.
Please see the documentation for WebBrowser
for an overview of the Selenium DSL.
This class is enables the following syntax:
switch to defaultContent ^
This object is part of ScalaTest's Selenium DSL.
Delete all cookies in the current domain from web browser.
Delete all cookies in the current domain from web browser.
the WebDriver
with which to drive the browser
Delete cookie with the specified name from web browser, throws TestFailedException if the specified cookie does not exists.
Delete cookie with the specified name from web browser, throws TestFailedException if the specified cookie does not exists.
cookie's name
the WebDriver
with which to drive the browser
Clears the current active TextField
or TextArea
, and presses the passed keys.
Clears the current active TextField
or TextArea
, and presses the passed keys.
Throws TestFailedException
if current active is not TextField
or TextArea
.
keys to press in current active TextField
or TextArea
Executes an asynchronous piece of JavaScript in the context of the currently selected frame or window.
Executes an asynchronous piece of JavaScript in the context of the currently selected frame or window. Unlike executing synchronous JavaScript, scripts executed with this method must explicitly signal they are finished by invoking the provided callback. This callback is always injected into the executed function as the last argument.
The first argument passed to the callback function will be used as the script's result. This value will be handled as follows:
Script arguments must be a number, a boolean, a String, WebElement, or a List of any combination of the above. An exception will be thrown if the arguments do not meet these criteria. The arguments will be made available to the JavaScript via the "arguments" variable.
the JavaScript to execute
the arguments to the script, may be empty
One of Boolean, Long, String, List, WebElement, or null
Executes JavaScript in the context of the currently selected frame or window.
Executes JavaScript in the context of the currently selected frame or window. The script fragment provided will be executed as the body of an anonymous function.
Within the script, you can use document
to refer to the current document. Local variables will not be available once the script has finished executing, but global variables will.
To return a value (e.g. if the script contains a return statement), then the following steps will be taken:
the JavaScript to execute
the arguments to the script, may be empty
One of Boolean, Long, String, List or WebElement. Or null
Finds and returns the first element selected by the specified string ID or name, wrapped
in a Some
, or None
if no element is selected.
Finds and returns the first element selected by the specified string ID or name, wrapped
in a Some
, or None
if no element is selected. YYY
This method will try to lookup by id first. If it cannot find
any element with an id equal to the specified queryString
, it will then try lookup by name.
The class of the Element
returned will be a subtype of Element
if appropriate.
For example, if the query selects a text field, the class of the returned Element
will
be TextField
.
the string with which to search, first by ID then by name
the WebDriver
with which to drive the browser
the Element
selected by this query, wrapped in a Some
, or None
if
no Element
is selected
Finds and returns the first element selected by the specified Query
, wrapped
in a Some
, or None
if no element is selected.
Finds and returns the first element selected by the specified Query
, wrapped
in a Some
, or None
if no element is selected.
The class of the Element
returned will be a subtype of Element
if appropriate.
For example, if the query selects a text field, the class of the returned Element
will
be TextField
.
the Query
with which to search
the WebDriver
with which to drive the browser
the Element
selected by this query, wrapped in a Some
, or None
if
no Element
is selected
Returns an Iterator
over all Element
s selected by the specified string ID or name
Returns an Iterator
over all Element
s selected by the specified string ID or name
This method will try to lookup by id first. If it cannot find
any element with an id equal to the specified queryString
, it will then try lookup by name.
The class of the Element
returned will be a subtype of Element
if appropriate.
For example, if the query selects a text field, the class of the returned Element
will
be TextField
.
the string with which to search, first by ID then by name
the WebDriver
with which to drive the browser
the Iterator
over all Element
s selected by this query
Returns an Iterator
over all Element
s selected by this query.
Returns an Iterator
over all Element
s selected by this query.
The class of the Element
s produced by the returned Iterator
will be a
subtypes of Element
if appropriate. For example, if an Element
representing
a text field is returned by the Iterator
, the class of the returned Element
will
be TextField
.
If no Elements
are selected by this query, this method will return an empty Iterator
will be returned.
the Query
with which to search
the WebDriver
with which to drive the browser
the Iterator
over all Element
s selected by this query
This method supports switching to a frame by Query
in ScalaTest's Selenium DSL.
This method supports switching to a frame by Query
in ScalaTest's Selenium DSL.
Please see the documentation for WebBrowser
for an overview of the Selenium DSL.
Query
used to select WebElement
which is contained in the frame to switch to
a FrameWebElementTarget instance
This method supports switching to a frame by element in ScalaTest's Selenium DSL.
This method supports switching to a frame by element in ScalaTest's Selenium DSL.
Please see the documentation for WebBrowser
for an overview of the Selenium DSL.
Element
which is contained in the frame to switch to
a FrameElementTarget instance
This method supports switching to a frame by web element in ScalaTest's Selenium DSL.
This method supports switching to a frame by web element in ScalaTest's Selenium DSL.
Please see the documentation for WebBrowser
for an overview of the Selenium DSL.
WebElement
which is contained in the frame to switch to
a FrameWebElementTarget instance
This method supports switching to a frame by name or ID in ScalaTest's Selenium DSL.
This method supports switching to a frame by name or ID in ScalaTest's Selenium DSL.
Please see the documentation for WebBrowser
for an overview of the Selenium DSL.
This class is enables the following syntax:
switch to frame("name") ^
name or ID of the frame to switch to
a FrameNameOrIdTarget instance
This method supports switching to a frame by index in ScalaTest's Selenium DSL.
This method supports switching to a frame by index in ScalaTest's Selenium DSL.
Please see the documentation for WebBrowser
for an overview of the Selenium DSL.
This class is enables the following syntax:
switch to frame(0) ^
the index of frame to switch to
a FrameIndexTarget instance
This object is part of ScalaTest's Selenium DSL.
Go back to previous page.
Go back to previous page.
the WebDriver
with which to drive the browser
Go forward to next page.
Go forward to next page.
the WebDriver
with which to drive the browser
Sends the browser to the URL contained in the passed Page
object.
Sends the browser to the URL contained in the passed Page
object.
Here's an example:
goTo(homePage)
the Page
object containing the URL to which to send the browser
the WebDriver
with which to drive the browser
Sends the browser to the passed URL.
Sends the browser to the passed URL.
Here's an example:
goTo("http://www.artima.com")
the URL to which to send the browser
the WebDriver
with which to drive the browser
Returns an ID query.
Returns an ID query.
This method enables syntax such as the following:
click on id("q")
^
Sets the amount of time the driver should wait when searching for an element that is not immediately present.
Sets the amount of time the driver should wait when searching for an element that is not immediately present.
When searching for requested elements, Selenium will poll the page until the requested element (or at least one of multiple requested
elements) is found or this "implicit wait" timeout has expired.
If the timeout expires, Selenium will throw NoSuchElementException
, which ScalaTest's Selenium DSL will wrap in a TestFailedException
.
You can alternatively set this timeout to zero and use ScalaTest's eventually
construct.
This method invokes manage.timeouts.implicitlyWait
on the passed WebDriver
. See the documentation of Selenium's
WebDriver#Timeouts
interface for more information.
the time span to implicitly wait
the WebDriver
on which to set the implicit wait
Check if screenshot is supported
Check if screenshot is supported
the WebDriver
with which to drive the browser
true if screenshot is supported, false otherwise
Returns a link text query.
Returns a link text query.
This method enables syntax such as the following:
click on linkText("???")
^
Finds and returns the first MultiSel
selected by the specified string ID or name, throws TestFailedException
if element not found or the found element is not a MultiSel
.
Finds and returns the first MultiSel
selected by the specified string ID or name, throws TestFailedException
if element not found or the found element is not a MultiSel
.
the string with which to search, first by ID then by name
the WebDriver
with which to drive the browser
the MultiSel
selected by this query
Finds and returns the first MultiSel
selected by the specified Query
, throws TestFailedException
if element not found or the found element is not a MultiSel
.
Finds and returns the first MultiSel
selected by the specified Query
, throws TestFailedException
if element not found or the found element is not a MultiSel
.
the Query
with which to search
the WebDriver
with which to drive the browser
the MultiSel
selected by this query
Returns a name query.
Returns a name query.
This method enables syntax such as the following:
click on name("q")
^
Returns the source of the current page.
Returns the source of the current page.
This method invokes getPageSource
on the passed WebDriver
and returns the result.
the WebDriver
with which to drive the browser
the source of the current page
Returns the title of the current page, or the empty string if the current page has no title.
Returns the title of the current page, or the empty string if the current page has no title.
the WebDriver
with which to drive the browser
the current page's title, or the empty string if the current page has no title
Returns a partial link text query.
Returns a partial link text query.
This method enables syntax such as the following:
click on partialLinkText("???")
^
Press the passed keys to current active element.
Press the passed keys to current active element.
keys to press in current active element
Close all windows, and exit the driver.
Close all windows, and exit the driver.
the WebDriver
on which to quit.
Finds and returns the first RadioButton
selected by the specified string ID or name, throws TestFailedException
if element not found or the found element is not a RadioButton
.
Finds and returns the first RadioButton
selected by the specified string ID or name, throws TestFailedException
if element not found or the found element is not a RadioButton
.
the string with which to search, first by ID then by name
the WebDriver
with which to drive the browser
the RadioButton
selected by this query
Finds and returns the first RadioButton
selected by the specified Query
, throws TestFailedException
if element not found or the found element is not a RadioButton
.
Finds and returns the first RadioButton
selected by the specified Query
, throws TestFailedException
if element not found or the found element is not a RadioButton
.
the Query
with which to search
the WebDriver
with which to drive the browser
the RadioButton
selected by this query
Finds and returns RadioButtonGroup
selected by the specified group name, throws TestFailedException
if
no element with the specified group name is found, or found any element with the specified group name but not a RadioButton
Finds and returns RadioButtonGroup
selected by the specified group name, throws TestFailedException
if
no element with the specified group name is found, or found any element with the specified group name but not a RadioButton
the group name with which to search
the WebDriver
with which to drive the browser
the RadioButtonGroup
selected by this query
Reload the current page.
Reload the current page.
the WebDriver
with which to drive the browser
Set capture directory.
Sets the amount of time to wait for an asynchronous script to finish execution before throwing an exception.
Sets the amount of time to wait for an asynchronous script to finish execution before throwing an exception.
the amount of time to wait for an asynchronous script to finish execution before throwing exception
Finds and returns the first SingleSel
selected by the specified string ID or name, throws TestFailedException
if element not found or the found element is not a SingleSel
.
Finds and returns the first SingleSel
selected by the specified string ID or name, throws TestFailedException
if element not found or the found element is not a SingleSel
.
the string with which to search, first by ID then by name
the WebDriver
with which to drive the browser
the SingleSel
selected by this query
Finds and returns the first SingleSel
selected by the specified Query
, throws TestFailedException
if element not found or the found element is not a SingleSel
.
Finds and returns the first SingleSel
selected by the specified Query
, throws TestFailedException
if element not found or the found element is not a SingleSel
.
the Query
with which to search
the WebDriver
with which to drive the browser
the SingleSel
selected by this query
Submit the form where current active element belongs to, and throws TestFailedException if current active element is not in a form or underlying WebDriver encounters problem when submitting the form.
Submit the form where current active element belongs to, and throws TestFailedException if current active element is not in a form or underlying WebDriver encounters problem when submitting the form. If this causes the current page to change, this call will block until the new page is loaded.
the WebDriver
with which to drive the browser
This object is part of ScalaTest's Selenium DSL.
Switch to the specified SwitchTarget
Switch to the specified SwitchTarget
the SwitchTarget
to switch to
the WebDriver
with which to drive the browser
instance of specified SwitchTarget
's type parameter
Returns a tag name query.
Returns a tag name query.
This method enables syntax such as the following:
click on tagName("???")
^
Finds and returns the first TextArea
selected by the specified string ID or name, throws TestFailedException
if element not found or the found element is not a TextArea
.
Finds and returns the first TextArea
selected by the specified string ID or name, throws TestFailedException
if element not found or the found element is not a TextArea
.
the string with which to search, first by ID then by name
the WebDriver
with which to drive the browser
the TextArea
selected by this query
Finds and returns the first TextArea
selected by the specified Query
, throws TestFailedException
if element not found or the found element is not a TextArea
.
Finds and returns the first TextArea
selected by the specified Query
, throws TestFailedException
if element not found or the found element is not a TextArea
.
the Query
with which to search
the WebDriver
with which to drive the browser
the TextArea
selected by this query
Finds and returns the first TextField
selected by the specified string ID or name, throws TestFailedException
if element not found or the found element is not a TextField
.
Finds and returns the first TextField
selected by the specified string ID or name, throws TestFailedException
if element not found or the found element is not a TextField
.
the string with which to search, first by ID then by name
the WebDriver
with which to drive the browser
the TextField
selected by this query
Finds and returns the first TextField
selected by the specified Query
, throws TestFailedException
if element not found or the found element is not a TextField
.
Finds and returns the first TextField
selected by the specified Query
, throws TestFailedException
if element not found or the found element is not a TextField
.
the Query
with which to search
the WebDriver
with which to drive the browser
the TextField
selected by this query
WebBrowser
subtrait that defines an implicit WebDriver
for Safari (an org.openqa.selenium.safari.SafariDriver
).
WebBrowser
subtrait that defines an implicit WebDriver
for Safari (an org.openqa.selenium.safari.SafariDriver
).
This class supports switching to a window by name or handle in ScalaTest's Selenium DSL.
This class supports switching to a window by name or handle in ScalaTest's Selenium DSL.
Please see the documentation for WebBrowser
for an overview of the Selenium DSL.
This class is enables the following syntax:
switch to window(windowHandle) ^
name or window handle of the window to switch to
a WindowTarget instance
Get an opaque handle to current active window that uniquely identifies it within the implicit driver instance.
Get an opaque handle to current active window that uniquely identifies it within the implicit driver instance.
the WebDriver
with which to drive the browser
Get a set of window handles which can be used to iterate over all open windows
Get a set of window handles which can be used to iterate over all open windows
the WebDriver
with which to drive the browser
Execute the given function, if ModifiableMessage
exception is thrown from the given function,
a screenshot will be captured automatically into capture directory, which by default is system property's java.
Execute the given function, if ModifiableMessage
exception is thrown from the given function,
a screenshot will be captured automatically into capture directory, which by default is system property's java.io.tmpdir.
You can change capture directory by calling setCaptureDir
function to execute
Returns an XPath query.
Returns an XPath query.
This method enables syntax such as the following:
click on xpath("???")
^
The title method will be removed in the next 2.0 milestone release. Please use pageTitle instead.
The wait method will be removed in the next 2.0 milestone release. Please use eventually instead.
WebBrowser
subtrait that defines an implicitWebDriver
for Safari (anorg.openqa.selenium.safari.SafariDriver
).