C# Class OpenQA.Selenium.Remote.RemoteWebElement

RemoteWebElement allows you to have access to specific items that are found on the page
Inheritance: IWebElement, IFindsByLinkText, IFindsById, IFindsByName, IFindsByTagName, IFindsByClassName, IFindsByXPath, IFindsByPartialLinkText, IFindsByCssSelector, IWrapsDriver, ILocatable, ITakesScreenshot
Afficher le fichier Open project: asynchrony/Selenium2 Class Usage Examples

Private Properties

Свойство Type Description

Méthodes publiques

Méthode Description
Clear ( ) : void

Method to clear the text out of an Input element

Click ( ) : void

Click this element. If this causes a new page to load, this method will block until the page has loaded. At this point, you should discard all references to this element and any further operations performed on this element will have undefined behaviour unless you know that the element and the page will still be present. If this element is not clickable, then this operation is a no-op since it's pretty common for someone to accidentally miss the target when clicking in Real Life

Equals ( object obj ) : bool

Compares if two elements are equal

FindElement ( By by ) : IWebElement

Finds the first element in the page that matches the By object

FindElementByClassName ( string className ) : IWebElement

Finds the first element in the page that matches the CSS Class supplied

FindElementByCssSelector ( string cssSelector ) : IWebElement

Finds the first element matching the specified CSS selector.

FindElementById ( string id ) : IWebElement

Finds the first element in the page that matches the ID supplied

FindElementByLinkText ( string linkText ) : IWebElement

Finds the first of elements that match the link text supplied

FindElementByName ( string name ) : IWebElement

Finds the first of elements that match the name supplied

FindElementByPartialLinkText ( string partialLinkText ) : IWebElement

Finds the first of elements that match the part of the link text supplied

FindElementByTagName ( string tagName ) : IWebElement

Finds the first of elements that match the DOM Tag supplied

FindElementByXPath ( string xpath ) : IWebElement

Finds the first of elements that match the XPath supplied

FindElements ( By by ) : ReadOnlyCollection

Finds the elements on the page by using the By object and returns a ReadOnlyCollection of the Elements on the page

FindElementsByClassName ( string className ) : ReadOnlyCollection

Finds a list of elements that match the classname supplied

FindElementsByCssSelector ( string cssSelector ) : ReadOnlyCollection

Finds all elements matching the specified CSS selector.

FindElementsById ( string id ) : ReadOnlyCollection

Finds the first element in the page that matches the ID supplied

FindElementsByLinkText ( string linkText ) : ReadOnlyCollection

Finds the first of elements that match the link text supplied

FindElementsByName ( string name ) : ReadOnlyCollection

Finds a list of elements that match the name supplied

FindElementsByPartialLinkText ( string partialLinkText ) : ReadOnlyCollection

Finds a list of elements that match the classname supplied

FindElementsByTagName ( string tagName ) : ReadOnlyCollection

Finds a list of elements that match the DOM Tag supplied

FindElementsByXPath ( string xpath ) : ReadOnlyCollection

Finds a list of elements that match the XPath supplied

GetAttribute ( string attributeName ) : string

If this current element is a form, or an element within a form, then this will be submitted to the remote server. If this causes the current page to change, then this method will block until the new page is loaded.

GetCssValue ( string propertyName ) : string

Method to return the value of a CSS Property

GetHashCode ( ) : int

Method to get the hash code of the element

RemoteWebElement ( RemoteWebDriver parentDriver, string id ) : System

Initializes a new instance of the RemoteWebElement class.

Select ( ) : void

Select or unselect element. This operation only applies to input elements such as checkboxes, options in a select and radio buttons.

SendKeys ( string text ) : void

Method for sending native key strokes to the browser

Submit ( ) : void

If this current element is a form, or an element within a form, then this will be submitted to the remote server. If this causes the current page to change, then this method will block until the new page is loaded.

Toggle ( ) : bool

If the element is a checkbox this will toggle the elements state from selected to not selected, or from not selected to selected

Méthodes protégées

Méthode Description
Execute ( DriverCommand commandToExecute, object>.Dictionary parameters ) : OpenQA.Selenium.Remote.Response

Executes a command on this element using the specified parameters.

FindElement ( string mechanism, string value ) : IWebElement

Finds a child element matching the given mechanism and value.

FindElements ( string mechanism, string value ) : ReadOnlyCollection

Finds all child elements matching the given mechanism and value.

Method Details

Clear() public méthode

Method to clear the text out of an Input element
public Clear ( ) : void
Résultat void

Click() public méthode

Click this element. If this causes a new page to load, this method will block until the page has loaded. At this point, you should discard all references to this element and any further operations performed on this element will have undefined behaviour unless you know that the element and the page will still be present. If this element is not clickable, then this operation is a no-op since it's pretty common for someone to accidentally miss the target when clicking in Real Life
public Click ( ) : void
Résultat void

Equals() public méthode

Compares if two elements are equal
public Equals ( object obj ) : bool
obj object Object to compare against
Résultat bool

Execute() protected méthode

Executes a command on this element using the specified parameters.
protected Execute ( DriverCommand commandToExecute, object>.Dictionary parameters ) : OpenQA.Selenium.Remote.Response
commandToExecute DriverCommand The to execute against this element.
parameters object>.Dictionary A containing names and values of the parameters for the command.
Résultat OpenQA.Selenium.Remote.Response

FindElement() public méthode

Finds the first element in the page that matches the By object
public FindElement ( By by ) : IWebElement
by By By mechanism to find the element
Résultat IWebElement

FindElement() protected méthode

Finds a child element matching the given mechanism and value.
protected FindElement ( string mechanism, string value ) : IWebElement
mechanism string The mechanism by which to find the element.
value string The value to use to search for the element.
Résultat IWebElement

FindElementByClassName() public méthode

Finds the first element in the page that matches the CSS Class supplied
public FindElementByClassName ( string className ) : IWebElement
className string className of the
Résultat IWebElement

FindElementByCssSelector() public méthode

Finds the first element matching the specified CSS selector.
public FindElementByCssSelector ( string cssSelector ) : IWebElement
cssSelector string The id to match.
Résultat IWebElement

FindElementById() public méthode

Finds the first element in the page that matches the ID supplied
public FindElementById ( string id ) : IWebElement
id string ID of the element
Résultat IWebElement

FindElementByLinkText() public méthode

Finds the first of elements that match the link text supplied
public FindElementByLinkText ( string linkText ) : IWebElement
linkText string Link text of element
Résultat IWebElement

FindElementByName() public méthode

Finds the first of elements that match the name supplied
public FindElementByName ( string name ) : IWebElement
name string Name of the element
Résultat IWebElement

FindElementByPartialLinkText() public méthode

Finds the first of elements that match the part of the link text supplied
public FindElementByPartialLinkText ( string partialLinkText ) : IWebElement
partialLinkText string part of the link text
Résultat IWebElement

FindElementByTagName() public méthode

Finds the first of elements that match the DOM Tag supplied
public FindElementByTagName ( string tagName ) : IWebElement
tagName string tag name of the element
Résultat IWebElement

FindElementByXPath() public méthode

Finds the first of elements that match the XPath supplied
public FindElementByXPath ( string xpath ) : IWebElement
xpath string xpath to the element
Résultat IWebElement

FindElements() public méthode

Finds the elements on the page by using the By object and returns a ReadOnlyCollection of the Elements on the page
public FindElements ( By by ) : ReadOnlyCollection
by By By mechanism to find the element
Résultat ReadOnlyCollection

FindElements() protected méthode

Finds all child elements matching the given mechanism and value.
protected FindElements ( string mechanism, string value ) : ReadOnlyCollection
mechanism string The mechanism by which to find the elements.
value string The value to use to search for the elements.
Résultat ReadOnlyCollection

FindElementsByClassName() public méthode

Finds a list of elements that match the classname supplied
public FindElementsByClassName ( string className ) : ReadOnlyCollection
className string CSS class name of the elements on the page
Résultat ReadOnlyCollection

FindElementsByCssSelector() public méthode

Finds all elements matching the specified CSS selector.
public FindElementsByCssSelector ( string cssSelector ) : ReadOnlyCollection
cssSelector string The CSS selector to match.
Résultat ReadOnlyCollection

FindElementsById() public méthode

Finds the first element in the page that matches the ID supplied
public FindElementsById ( string id ) : ReadOnlyCollection
id string ID of the Element
Résultat ReadOnlyCollection

FindElementsByLinkText() public méthode

Finds the first of elements that match the link text supplied
public FindElementsByLinkText ( string linkText ) : ReadOnlyCollection
linkText string Link text of element
Résultat ReadOnlyCollection

FindElementsByName() public méthode

Finds a list of elements that match the name supplied
public FindElementsByName ( string name ) : ReadOnlyCollection
name string Name of element
Résultat ReadOnlyCollection

FindElementsByPartialLinkText() public méthode

Finds a list of elements that match the classname supplied
public FindElementsByPartialLinkText ( string partialLinkText ) : ReadOnlyCollection
partialLinkText string part of the link text
Résultat ReadOnlyCollection

FindElementsByTagName() public méthode

Finds a list of elements that match the DOM Tag supplied
public FindElementsByTagName ( string tagName ) : ReadOnlyCollection
tagName string DOM Tag of the element on the page
Résultat ReadOnlyCollection

FindElementsByXPath() public méthode

Finds a list of elements that match the XPath supplied
public FindElementsByXPath ( string xpath ) : ReadOnlyCollection
xpath string xpath to element on the page
Résultat ReadOnlyCollection

GetAttribute() public méthode

If this current element is a form, or an element within a form, then this will be submitted to the remote server. If this causes the current page to change, then this method will block until the new page is loaded.
public GetAttribute ( string attributeName ) : string
attributeName string Attribute you wish to get details of
Résultat string

GetCssValue() public méthode

Method to return the value of a CSS Property
public GetCssValue ( string propertyName ) : string
propertyName string CSS property key
Résultat string

GetHashCode() public méthode

Method to get the hash code of the element
public GetHashCode ( ) : int
Résultat int

RemoteWebElement() public méthode

Initializes a new instance of the RemoteWebElement class.
public RemoteWebElement ( RemoteWebDriver parentDriver, string id ) : System
parentDriver RemoteWebDriver The instance hosting this element.
id string The ID assigned to the element.
Résultat System

Select() public méthode

Select or unselect element. This operation only applies to input elements such as checkboxes, options in a select and radio buttons.
public Select ( ) : void
Résultat void

SendKeys() public méthode

Method for sending native key strokes to the browser
public SendKeys ( string text ) : void
text string String containing what you would like to type onto the screen
Résultat void

Submit() public méthode

If this current element is a form, or an element within a form, then this will be submitted to the remote server. If this causes the current page to change, then this method will block until the new page is loaded.
public Submit ( ) : void
Résultat void

Toggle() public méthode

If the element is a checkbox this will toggle the elements state from selected to not selected, or from not selected to selected
public Toggle ( ) : bool
Résultat bool