Click or drag to resize
DriverUtilities Class
This class has some reusable methods for interacting with UI
Inheritance Hierarchy
SystemObject
  SeleniumUtilitiesDriverUtilities

Namespace: SeleniumUtilities
Assembly: SeleniumUtilities (in SeleniumUtilities.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public class DriverUtilities

The DriverUtilities type exposes the following members.

Constructors
  NameDescription
Public methodDriverUtilities
Initializes a new instance of the DriverUtilities class
Top
Methods
  NameDescription
Public methodStatic memberAcceptAndCloseAlert
This method is used to close the Alert/pop-up by clicking Yes/Accept button from Alet/Pop-up
Public methodStatic memberActionBuilder
This method is used to return Actions object for building custom keyboard/mouse actions
Public methodStatic memberClearTextIgnoringStaleElementException
Clear text from textbox ignoring the Stale Element exception
Public methodStatic memberClickOnCellTextFromTable
Clicks on specific cell of a table as per given row and column index
Public methodStatic memberClickOnElement
This method is used to click on IWebelement by using "By" locator
Public methodStatic memberClickOnElementIgnoringStaleElementException
Clcik on Element ignoring the Stale Element exception
Public methodStatic memberClickOnSpecificCellFromTable
Clicks on specific cell# from table
Public methodStatic memberCloseAlertAndGetItsText
This method is used to close the Alert/pop-up and get message from the pop-up
Public methodStatic memberDragAndDrop
Used to drag and drop the element
Public methodStatic memberDropdown(By)
Public methodStatic memberDropdown(IWebElement)
This method is used to choose the dropdown by its identifier
Public methodStatic memberEnterText
This method is used to enter the text in the specified element
Public methodStatic memberEnterTextIgnoringStaleElementException
Enter Text in text box ignoring the Stale Element exception
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodStatic memberFindElement
Public methodStatic memberGetAllItemsToStringList
This method is used to get a list of "Text" values for items in IWebelement list
Public methodStatic memberGetAllItemsToStringListExcludingBlank
This method is used to get a list of "Text" values for items in IWebelement list excluding blank values
Public methodStatic memberGetAttributeValue
Get value of a specific attribute
Public methodStatic memberGetCollection
This method simultates "driver.findElements" and is useful to get collection
Public methodStatic memberGetCollectionFromPageToStringList
This method is used to get a list of "Text" values for items from collection on page
Public methodStatic memberGetCollectionFromPageToStringListWit
This method is used to get a list of "Text" values for items from collection on page,without last blank value if any
Public methodStatic memberGetCollectionToList
This method is used to get the similar elements to the IWebElement list
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodStatic memberGetIndexOfRowContainingSpecificText
Returns the row number of required text by using common row identifier and requiredtext
Public methodStatic memberGetIndexOfTableRowContainingSpecificText
Returns the row number of required text by using table identifier and requiredtext
Public methodStatic memberGetIwebElementTextToStringList
This method is used to get all text items of the IWebElement list to the string list
Public methodStatic memberGetNumberOfRowsInTable(By)
Gets the number of rows in a table on the screen, by providing the 'By' selector for table
Public methodStatic memberGetNumberOfRowsInTable(IWebElement)
Gets the number of rows in a table on the screen, by providing the identifier for table
Public methodStatic memberGetText
This method is used to get the text value of specified element
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodStatic memberGetValueFromSpecificCellFromTable(By, Int32, Int32)
Returns the value from specific cell of a table as per given row and column index
Public methodStatic memberGetValueFromSpecificCellFromTable(IWebElement, Int32, Int32)
Returns the value from specific cell of a table as per given row and column index
Public methodStatic memberGetValuesOfColumnFromTable
Gets values from a specified column from table, using columname from table
Public methodStatic memberGetValuesOfSpecificColumnFromTable(By, Int32)
This method is used to the get all values from specific column of table by providing tag identifier and column index Note: Column index starts from zero
Public methodStatic memberGetValuesOfSpecificColumnFromTable(IWebElement, Int32)
This method is used to the get all values from specific column of table by providing table identifier and column index
Public methodStatic memberHandleNotNullInnerException
This method is used to handle exceptions having some Inner exception message
Public methodStatic memberHandleNullInnerException
This methos is used to handle the exceptions with NULL inner exception messages
Public methodStatic memberImplicitWait
Implicit timeout in seconds
Public methodStatic memberIsAlertPresent
This method is used to check if the Alert/Pop-up is present
Public methodStatic memberIsElementPresent(By)
This method is used to check if the specified element is present on the page
Public methodStatic memberIsElementPresent(IWebElement)
This method is used to check if the specified element is present on the page
Public methodStatic memberJsClick
Click the provided identifier using JavaScript(jQuery) click event
Public methodStatic memberJsExecutor
Returns the JavaScript executor for performing JavaScript Operations
Public methodStatic memberJsScrollTillEnd
Used to scroll till end of the page
Public methodStatic memberJsScrollTillPoint
Scrolls page to the specified cordinates
Public methodStatic memberJsScrollToTop
Used to scroll to top of the page
Public methodStatic memberLoginWithDifferentUser
This method is used login with difeerent users for a website Note:This will work for chrome browser by default, for IE you might need to do some settings
Public methodStatic memberManageFailure
This method is used to handle exceptions during test execution,this is specifically useful to restart the driver when gets stopped/Not-Responding due to some unexpected issues
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodStatic memberMoveCursor
Method to set the postion of the Mouse cursor on screen

Need to specify X and Y cordinates for desired mouse cursor postion. Check Point for more information.

Public methodStatic memberNavigateToURL
This method is used to Navigate to URL
Public methodStatic memberPrintStringList
Prints the items in List of string items
Public methodStatic memberSelectFromDrpDwnIgnoringStaleElementException
This method is used to select value from Select Tag dropdown by ignoring a Stale Element Exception
Public methodStatic memberSelectFromListDropDown
To select a element from List dropdown
Public methodStatic memberSelectFromListDrpDwnIgnoringStaleElementException
To Select a element from list dropdown ignoring the Stale Element exception
Public methodStatic memberSetfocusAndClickOnIWebElement
This method is used to set the mouse focus to the element specified by identifier
Public methodStatic memberSetfocusOnIWebElement
This method is used to set the mouse focus to specified element
Public methodStatic memberSetup
This method is uesed to launch the browser (driver) based on the browser configured in App.config
Public methodStatic memberSplitEachItemInStringCollectionAndAddtoList
Splits each item from string collection and adds it to string list
Public methodStatic memberSwitchToDilog
Used to switch to SharePoint dlg
Public methodStatic memberSwitchToWindow
Switch to tab using a predicate condition
Public methodStatic memberTakeScreenshot
This method is used to take a screenshot,it also returns the location of screenshot
Public methodStatic memberTeardown
This method is used to close the browser(driver)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodStatic memberWait
This method returns the object of WebdriverWait class for using methods like Wait.Until...
Public methodStatic memberWaitForElementIsClickable(By, Int32)
This method is used to wait for element to be ready before clicking
Public methodStatic memberWaitForElementIsClickable(IWebElement, Int32)
This method is used to wait for element to be ready before clicking
Public methodStatic memberWaitForElementToGetInVisible
This method is used to wait for element to get invisible
Public methodStatic memberWaitForElementVisible
Method to wait for Element to be Visible

You need to pass the locator and time to wait for in seconds default time is 30 secondsWebDriverWait for more information.

Top
Fields
  NameDescription
Public fieldStatic memberbrowser
Public fieldStatic memberdriver
Top
Properties
  NameDescription
Public propertyStatic memberdateTimeStamp
This method returns the current dateTimeStamp
Top
See Also