Table of Contents

Class SeleniumService

Namespace
SunamoSelenium.Services
Assembly
SunamoSelenium.dll

Provides Selenium WebDriver utility methods for waiting and finding elements.

public class SeleniumService
Inheritance
SeleniumService
Inherited Members
Extension Methods

Constructors

SeleniumService(IWebDriver, ILogger)

Provides Selenium WebDriver utility methods for waiting and finding elements.

public SeleniumService(IWebDriver driver, ILogger logger)

Parameters

driver IWebDriver
logger ILogger

Methods

FindElement(By)

Finds the first element matching the specified locator, or returns null if not found.

public IWebElement? FindElement(By locator)

Parameters

locator By

The OpenQA.Selenium.By locator identifying the element to find.

Returns

IWebElement

The first matching OpenQA.Selenium.IWebElement or null if no elements match.

WaitForElementIsVisible(By)

Waits up to 3 seconds for the element specified by the locator to become visible.

public void WaitForElementIsVisible(By locator)

Parameters

locator By

The OpenQA.Selenium.By locator identifying the element to wait for.

WaitForPageReady()

Waits until the page document.readyState equals "complete", with a 15-second timeout. Logs the result and elapsed time.

public void WaitForPageReady()