Table of Contents

Class QuestionQueryBuilder

Namespace
CSF.Screenplay.Selenium.Builders
Assembly
CSF.Screenplay.Selenium.dll

Provides methods to build performable questions for a Selenium element, which are based upon querying/interrogating values from that element.

public class QuestionQueryBuilder
Inheritance
QuestionQueryBuilder
Inherited Members

Constructors

QuestionQueryBuilder(ITarget)

Initializes a new instance of the QuestionQueryBuilder class with the specified Selenium element.

public QuestionQueryBuilder(ITarget target)

Parameters

target ITarget

The Selenium element to be used by the query builder.

Methods

AllOptions()

Gets a performable question which reads all of the available options (whether selected or not) from a <select> element.

public IPerformableWithResult<IReadOnlyList<Option>> AllOptions()

Returns

IPerformableWithResult<IReadOnlyList<Option>>

A performable question

Remarks

This question is only valid for <select> elements. For any other type of element, the behaviour is undefined.

SelectedOptions()

Gets a performable question which reads the selected options from a <select> element.

public IPerformableWithResult<IReadOnlyList<Option>> SelectedOptions()

Returns

IPerformableWithResult<IReadOnlyList<Option>>

A performable question

Remarks

This question is only valid for <select> elements. For any other type of element, the behaviour is undefined.

TheAttribute(string)

Gets a performable question which reads the value of the specified attribute from the element.

public IPerformableWithResult<string> TheAttribute(string attributeName)

Parameters

attributeName string

The name of the attribute from which to read the value

Returns

IPerformableWithResult<string>

A performable question

TheClickability()

Gets a performable question which checks the clickability of the element.

public IPerformableWithResult<bool> TheClickability()

Returns

IPerformableWithResult<bool>

A performable question

TheCssProperty(string)

Gets a performable question which reads the value of the specified CSS property from the element.

public IPerformableWithResult<string> TheCssProperty(string propertyName)

Parameters

propertyName string

The name of the CSS property from which to read the value

Returns

IPerformableWithResult<string>

A performable question

TheLocation()

Gets a performable question which reads the pixel location (top-left corner) of the element.

public IPerformableWithResult<Point> TheLocation()

Returns

IPerformableWithResult<Point>

A performable question

TheSize()

Gets a performable question which reads the pixel size (width and height) of the element.

public IPerformableWithResult<Size> TheSize()

Returns

IPerformableWithResult<Size>

A performable question

TheText()

Gets a performable question which reads the text content of the element.

public IPerformableWithResult<string> TheText()

Returns

IPerformableWithResult<string>

A performable question

TheValue()

Gets a performable question which reads the value of the element.

public IPerformableWithResult<string> TheValue()

Returns

IPerformableWithResult<string>

A performable question

TheVisibility()

Gets a performable question which checks the visibility of the element.

public IPerformableWithResult<bool> TheVisibility()

Returns

IPerformableWithResult<bool>

A performable question

UnselectedOptions()

Gets a performable question which reads the unselected options from a <select> element.

public IPerformableWithResult<IReadOnlyList<Option>> UnselectedOptions()

Returns

IPerformableWithResult<IReadOnlyList<Option>>

A performable question

Remarks

This question is only valid for <select> elements. For any other type of element, the behaviour is undefined.