Class EnterTheDateBuilder
- Namespace
- CSF.Screenplay.Selenium.Builders
- Assembly
- CSF.Screenplay.Selenium.dll
A builder type which creates an instance of EnterTheDate.
public class EnterTheDateBuilder : IGetsPerformable
- Inheritance
-
EnterTheDateBuilder
- Implements
- Inherited Members
Constructors
EnterTheDateBuilder(DateTime?)
Initializes a new instance of the EnterTheDateBuilder class with the specified date.
public EnterTheDateBuilder(DateTime? date)
Parameters
dateDateTime?The date to enter, or null
Methods
ForTheCultureNamed(string)
Specifies the culture for which to enter the date. This must be the culture in which the web browser is operating.
public EnterTheDateBuilder ForTheCultureNamed(string cultureIdentifier)
Parameters
cultureIdentifierstringA culture identifier string
Returns
- EnterTheDateBuilder
This same builder, so calls may be chained
Examples
For example, a British English browser en-GB expects dates to be entered in the format ddMMyyyy.
However, a US English browser en-US expects dates to be entered in the format MMddyyyy.
The cultureIdentifier parameter of this method must be the culture identifier of the culture which the
browser is operating under, such as en-GB.
Remarks
Web browser are culture-aware applications and they will render the input/display value of a date field using the culture in which their operating system is configured. This impacts the manner in which users input dates. If this method is not used, the task returned by this builder will use the culture of the operating system/environment that is executing the Screenplay Performance. This is usually OK when running the web browser locally, but it might not match the browser's culture when using remote web browsers.
Exceptions
- ArgumentNullException
If
cultureIdentifieris null- CultureNotFoundException
If
cultureIdentifierindicates a culture which is not found
GetPerformable()
Gets the performable object from the current instance.
public IPerformable GetPerformable()
Returns
- IPerformable
A performable object
Into(ITarget)
Specifies the target element into which to enter the date. This must be an <input type="date"> element.
public EnterTheDateBuilder Into(ITarget target)
Parameters
targetITargetThe target element
Returns
- EnterTheDateBuilder
This same builder, so calls may be chained
Exceptions
- ArgumentNullException
If
targetis null- InvalidOperationException
If this method is used more than once