C# Class Selenol.Page.BasePage

A Page class represents content of a web page or frame.
Inheritance: ISearchContext, IJavaScriptExecutor
Afficher le fichier Open project: pbakshy/Selenol Class Usage Examples

Private Properties

Свойство Type Description
CheckIsInitialized void
Initialize void
Validate void

Méthodes publiques

Méthode Description
ExecuteAsyncScript ( string script ) : object

Executes JavaScript asynchronously in the context of the current Page.

ExecuteScript ( string script ) : object

Executes JavaScript in the context of the current Page.

The M:OpenQA.Selenium.IJavaScriptExecutor.ExecuteScript(System.String,System.Object[]) method executes JavaScript in the context of the current Page. This means that "document" will refer to the current document. If the script has a return value, then the following steps will be taken:.

For an HTML element, this method returns a T:OpenQA.Selenium.IWebElement. For a number, a T:System.Int64 is returned. For a boolean, a T:System.Boolean is returned. For all other cases a T:System.String is returned. For an array,we check the first element, and attempt to return a T:System.Collections.Generic.List`1 of that type, following the rules above. Nested lists are not supported. If the value is null or there is no return value, is returned.

Arguments must be a number (which will be converted to a T:System.Int64 ), a T:System.Boolean , a T:System.String or a T:OpenQA.Selenium.IWebElement . An exception will be thrown if the arguments do not meet these criteria. The arguments will be made available to the JavaScript via the "arguments" magic variable, as if the function were called via "Function.apply".

.
FindElement ( By @by ) : IWebElement

Finds the first T:OpenQA.Selenium.IWebElement using the given method.

FindElements ( By @by ) : ReadOnlyCollection

Finds all IWebElements within the current context using the given mechanism.

Private Methods

Méthode Description
CheckIsInitialized ( ) : void
Initialize ( IWebDriver driver, IJavaScriptExecutor jsExecutor ) : void

Initializes the page.

Validate ( ) : void

Method Details

ExecuteAsyncScript() public méthode

Executes JavaScript asynchronously in the context of the current Page.
public ExecuteAsyncScript ( string script ) : object
script string The JavaScript code to execute.
Résultat object

ExecuteScript() public méthode

Executes JavaScript in the context of the current Page.

The M:OpenQA.Selenium.IJavaScriptExecutor.ExecuteScript(System.String,System.Object[]) method executes JavaScript in the context of the current Page. This means that "document" will refer to the current document. If the script has a return value, then the following steps will be taken:.

For an HTML element, this method returns a T:OpenQA.Selenium.IWebElement. For a number, a T:System.Int64 is returned. For a boolean, a T:System.Boolean is returned. For all other cases a T:System.String is returned. For an array,we check the first element, and attempt to return a T:System.Collections.Generic.List`1 of that type, following the rules above. Nested lists are not supported. If the value is null or there is no return value, is returned.

Arguments must be a number (which will be converted to a T:System.Int64 ), a T:System.Boolean , a T:System.String or a T:OpenQA.Selenium.IWebElement . An exception will be thrown if the arguments do not meet these criteria. The arguments will be made available to the JavaScript via the "arguments" magic variable, as if the function were called via "Function.apply".

.
public ExecuteScript ( string script ) : object
script string The JavaScript code to execute.
Résultat object

FindElement() public méthode

Finds the first T:OpenQA.Selenium.IWebElement using the given method.
If no element matches the criteria.
public FindElement ( By @by ) : IWebElement
@by OpenQA.Selenium.By
Résultat IWebElement

FindElements() public méthode

Finds all IWebElements within the current context using the given mechanism.
public FindElements ( By @by ) : ReadOnlyCollection
@by OpenQA.Selenium.By
Résultat ReadOnlyCollection