Class ClickBuilder
- Namespace
- CSF.Screenplay.Selenium.Builders
- Assembly
- CSF.Screenplay.Selenium.dll
Builder for creating click actions on a target element.
public class ClickBuilder : IGetsPerformable
- Inheritance
-
ClickBuilder
- Implements
- Inherited Members
Constructors
ClickBuilder(ITarget)
Initializes a new instance of the ClickBuilder class with the specified target.
public ClickBuilder(ITarget target)
Parameters
targetITargetThe target element to click. Cannot be null.
Exceptions
- ArgumentNullException
Thrown when
targetis null.
Methods
AndWaitForANewPageToLoad(TimeSpan?)
Gets a more sophisticated IPerformable which waits for a page-load to complete after clicking.
public IPerformable AndWaitForANewPageToLoad(TimeSpan? forAtMost = null)
Parameters
forAtMostTimeSpan?
Returns
Remarks
Use this method when the click is expected to cause a new web page to load into the browser.
In that case, the performable returned by this method will not only click on the target element.
It will also wait for the DOMContentLoaded event from the web page which is loaded following that click.
This ensures that subsequent interactions with the Web Browser are not performed upon a page which is not yet loaded.
Note that the meaning of "a new page loading" is a full Web Browser page load (an entirely new HTML document). It does not mean an SPA/JavaScript-based navigation. This method is not for JavaScrpit/SPA navigation.
GetPerformable()
Gets the performable object from the current instance.
public IPerformable GetPerformable()
Returns
- IPerformable
A performable object