Share this page

# Utils Class

UFT Developer for Selenium utilities.

## C# syntax

    public class Utils

## Inheritance hierarchy

    LeanFT.Selenium.Utils

Namespace: LeanFT.Selenium

Assembly: LeanFTForSelenium

The LeanFT.Selenium.Utils class exposes the following members:

## Method summary

| Name | Description
--- | --- | ---
| GetSnapshot(OpenQA.Selenium.IWebElement) | Returns a snapshot (image) of the selenium element.
| Highlight(OpenQA.Selenium.IWebElement) | Highlights the selenium element in the browser.
| Highlight(OpenQA.Selenium.IWebElement,System.Int32) | Highlights the selenium elements in the browser for time milliseconds.
| ScrollIntoView(OpenQA.Selenium.IWebElement) | Scrolls the page to make the web element visible.

Back to top

## Utils.GetSnapshot(OpenQA.Selenium.IWebElement)

Returns a snapshot (image) of the selenium element.

C# Syntax

    public static Image GetSnapshot(IWebElement element)

Parameters

element. The element to retrieve a snapshot for.

Returns

A snapshot of the element.

Return Type

System.Drawing.Image

Back to top

## Utils.Highlight(OpenQA.Selenium.IWebElement)

Highlights the selenium element in the browser.

C# Syntax

    public static void Highlight(IWebElement element)

Parameters

element. The web element to highlight.

Back to top

## Utils.Highlight(OpenQA.Selenium.IWebElement,System.Int32)

Highlights the selenium elements in the browser for time milliseconds.

C# Syntax

    public static void Highlight(IWebElement element, Int32 time)

Parameters

element. The web element to highlight.

time. The time (in milliseconds) that the element is highlighted. In case of a negative number, the method throws an ArgumentException.

If time is less than 150, the element is not highlighted.

Back to top

## Utils.ScrollIntoView(OpenQA.Selenium.IWebElement)

Scrolls the page to make the web element visible.

C# Syntax

    public static void ScrollIntoView(IWebElement element)

Parameters

element. The web element to scroll to.

Back to top

See also:

- LeanFT.Selenium Namespace

Tips to improve your search results... UFT Developer for Selenium SDK (.NET) Reference Version 15.0-15.0.2 UFT Developer SDK Reference All View Local Help Center View Online Help Center back Go back in browser history forward Go forward in browser history Remove search highlights next topic Go to next topic previous topic Go to previous topic Print the current topic Version: