Click or drag to resize

LocatorExtensions.ToBy Method

Framework to automate tests using Selenium WebDriver
From the locator to selenium by converter.

Namespace: Ocaramba.Extensions
Assembly: OcarambaLite (in OcarambaLite.dll) Version: 4.2.2
Syntax
C#
public static By ToBy(
	this ElementLocator locator
)
Request Example

Parameters

locator  ElementLocator
The element locator.

Return Value

By
The Selenium By.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type ElementLocator. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Example
Using standard method FindElement, even we have locator as ElementLocator:
C#
private readonly ElementLocator searchTextbox = new ElementLocator(Locator.Id, "SearchTextBoxId");
this.Driver.FindElement(searchTextbox.ToBy());
See Also