Class BrowserQuirks
- Namespace
- CSF.Screenplay.Selenium
- Assembly
- CSF.Screenplay.Selenium.dll
Static class which holds known browser quirks information.
public static class BrowserQuirks
- Inheritance
-
BrowserQuirks
- Inherited Members
Remarks
Quirks are a feature of the universal WebDriver factory. See the WebDriver quirks article for more information.
Fields
CannotSetInputTypeDateWithSendKeys
Gets the name of a browser quirk, for browsers which cannot set the value of an <input type="date"> using the
"Send Keys" technique.
public static readonly string CannotSetInputTypeDateWithSendKeys
Field Value
Remarks
Some WebDriver implementations permit typing a locale-formatted date string into the HTML element, as if it were any other
<input> element. Other WebDriver implementations cannot interact with Date inputs in that way and
can only enter a new value via a JavaScript workaround. This quirk marks browsers which require such a workaround.
The calendar UI which most browsers will render for a Date input field is not built from HTML elements and thus cannot be interacted with by a WebDriver. Thus, if we cannot 'type' a new date and cannot interact by clicking on the calendar, all that remains is to use a JavaScript workaround to set the date.
- See Also
NeedsToWaitAfterPageLoad
Gets the name of a browser quirk, for browsers which must be instructed to wait after navigating to a new web page, until that new page has finished loading.
public static readonly string NeedsToWaitAfterPageLoad
Field Value
Remarks
In traditional (non-SPA) web page navigation, there is a brief delay after clicking a hyperlink which navigates to a new web page. That delay is the time for the 'incoming' web page to load and render. During that delay, the 'outgoing' web page is still visible on-screen.
Most WebDriver implementations, those without this quirk, automatically wait during that loading delay. They do not execute further WebDriver commands until the 'incoming' web page has finished loading and is displayed on the screen. This prevents unexpected results and NoSuchElementException being thrown, and similar. Browsers/WebDrivers which are affected by this quirk (at the time of writing, all versions of Apple Safari) do not wait during this loading delay. This means that unless they are explicitly instructed to wait, they can attempt to execute further WebDriver commands prematurely.
The task ClickAndWaitForDocumentReady analyses the WebDriver for the presence of this quirk. If the quirk is present then the task inserts wait logic, to work around this behaviour of the affected Browser/WebDriver. This allows Selenium/Screenplay logic to be written in a manner that behaves consistently cross-browser.
It is important to remember that this behaviour and quirk applies only to traditional web browser navigation. That is a sequence in which the outgoing page is fully unloaded and the incoming page is retrieved and loaded from the webserver. It does not apply to navigating through Single Page Applications.
- See Also
Methods
GetQuirksData()
Gets hard-coded information about known browser quirks.
public static QuirksData GetQuirksData()
Returns
- QuirksData
Quirks data, about the peculiarities of specific browsers.
Remarks
This information ships with CSF.Screenplay.Selenium. It may be overridden by user-supplied configuration, should things change in the future. See the WebDriver quirks reference material for more information.