You are on page 1of 9

Selenium With C#

SESSION -01

First Selenium Example

IWebDriver Interface

TheIWebDriverinterface is the main interface to use for testing,


which represents an idealized web browser.

Three Categories

Control of the browser itself

Selection ofIWebElements

Debugging aids

Key properties and methods areUrl, which is used to load a new web page
by setting the property, and the various methods similar toFindElement
(By), which is used to findIWebElements.

IWebElement Interface

The IWebElement interface represents an HTML element. Generally,


all interesting operations to do with interacting with a page will be
performed through this interface.
Name
Clear

Description
Clears the content of this element.

Click

Clicks this element.

FindElement

Finds the first IWebElement using the given method.

FindElements

Finds allIWebElementswithin the current context using the


given mechanism.

GetAttribute

Gets the value of the specified attribute for this element.

GetCssValue

Gets the value of a CSS property of this element.

SendKeys

Simulates typing text into the element.

Submit

Submits this element to the web server.

Selenium Test using NUnit


Framework

NUnitis a unit testing framework for performing unit testing based on


the .NET platform

NUnit Installation

TextBox Control

Dropdown Control

Click Button Control

You might also like