Skip to content

Latest commit

 

History

History
56 lines (33 loc) · 1.12 KB

File metadata and controls

56 lines (33 loc) · 1.12 KB

Driver Methods

1. Close()

Used to close the currently focused window/tab.

If the browser has only one tab, it quits the browser

Driver.Close();

2. Quit()

It close every associated window for the driver.

Used to quits the browser.

Driver.Quit();

3. FindElement()

Parameter: By

Return Type: IWebElement

FindElement method is used to find the webelement by using the given By parameter.

It used to find the first occurence web element for the given locator.

IWebElement webElement = Driver.FindElement(By.Id("id_value"));

4. FindElements()

Parameter: By

Return Type: ReadOnlyCollection<IWebElement>

FindElement method is used to find the webelement by using the given By parameter.

It used to find the list of all webelements for the given locator.

ReadOnlyCollection<IWebElement> webElements = Driver.FindElements(By.Id("id_value"));

Note: For a same locator, FindElement method finds the first matching webelement and FindElements method finds the all possible matching webelements.

Navigate(), Manage(), SwitchTo() methods explained separately.