Building your own utilities for the Selenium automation framework
This section will guide you to develop the utilities for a Hybrid Automation framework which was built in the earlier stages in this chapter. The utilities are the functions that perform generic actions across the automation execution, for example, objClick
. The details are explained as follows:
Utilities are saved in the
genericLibrary
folder of the framework, which is saved in thepacktFramework
folder of the frameworkIn the framework, we have the
GoogleSearch.java
class fileIn the
GenericLib.java
class file, we have aGenericLib
class, which is a constructor
Let's understand the objClick
utility, which is used to perform a click action on any object type = Button
:
-------------------------------------------------------------------------------- public boolean objClick(WebElement element) throws Exception { try { if (element != null) { element.click(); return true; } LogResult.fail("Element not found to click on element having...