Class TextQueryBuilder
- Namespace
- CSF.Screenplay.Selenium.Builders
- Assembly
- CSF.Screenplay.Selenium.dll
Builder type for a performable that gets a single text value.
public class TextQueryBuilder : IGetsPerformableWithResult<string>
- Inheritance
-
TextQueryBuilder
- Implements
- Inherited Members
Remarks
The purpose of this builder is to enable or disable the trimming of whitespace characters at the beginning or end of the returned text.
Constructors
TextQueryBuilder(ITarget)
Initializes a new instance of the TextQueryBuilder class.
public TextQueryBuilder(ITarget element)
Parameters
elementITargetThe target element to query.
Methods
WithoutTrimmingWhitespace()
Configures the performable to disable the trimming of whitespace characters at the beginning or end of the returned text.
public TextQueryBuilder WithoutTrimmingWhitespace()
Returns
- TextQueryBuilder
The current instance of the builder, so calls may be chained.
Remarks
Trimming of whitespace at the beginning/end of text is enabled by default. This is because some browsers (Safari) include whitespace at the beginning/end of text read from the browser, which isn't visible to the end user. This is typically the space which is inherent in the markup, but which browsers ignore when actually displaying content.
Trimming it by default ensures that Screenplay reproduces functionality reliably cross-browser. If this causes an issue and you would like the leading/trailing whitespace included in the result then use this method. Note that you may see different results in browsers which include leading/trailing whitespace anyway.