Package co.verisoft.fw.pages
Interface WebBasePageJS
- All Known Implementing Classes:
WebBasePage
public interface WebBasePageJS
Default interface the main goal is to concentrate all mainly Java Script functions
- Author:
- David Yehezkel 29 Mar 2020
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault void
clickOnElementByJS
(String driverName, org.openqa.selenium.WebElement element) This method allows specifying a driver by its name.default void
clickOnElementByJS
(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement element) Main function that performs the actual click on a web element using JavaScript.default void
clickOnElementByJS
(org.openqa.selenium.WebElement element) This method is a convenient overload that uses the default WebDriver fromVerisoftDriverManager
.default String
getBeforePseudoCode
(String driverName, org.openqa.selenium.WebElement element) Retrieves the RGB color of a pseudo-element from the WebElement using a WebDriver identified by its name.default String
getBeforePseudoCode
(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement element) Main function that retrieves the RGB color of a pseudo-element from the WebElement using JavaScript.default String
getBeforePseudoCode
(org.openqa.selenium.WebElement element) Retrieves the RGB color of a pseudo-element from the WebElement using the default driver.default String
getColorOfBeforeCssAtter
(String driverName, org.openqa.selenium.WebElement element) Initializes a WebDriver based on the provided driver name (String) and delegates the task to given WebElement and returns the get css of ::before attributedefault String
getColorOfBeforeCssAtter
(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement element) This method accesses the shadow DOM of a given WebElement and returns the get css of ::before attributedefault String
getColorOfBeforeCssAtter
(org.openqa.selenium.WebElement element) Initializes the default WebDriver using theVerisoftDriverManager
and delegates the task to given WebElement and returns the get css of ::before attributedefault org.openqa.selenium.WebElement
getShadowRoot
(String driverName, org.openqa.selenium.WebElement rootElement) Initializes a WebDriver based on the provided driver name (String) and delegates the task to retrieves the shadow root element of a WebElement using JavaScript.default org.openqa.selenium.WebElement
getShadowRoot
(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement rootElement) Retrieves the shadow root element of a WebElement using JavaScript.default org.openqa.selenium.WebElement
getShadowRoot
(org.openqa.selenium.WebElement rootElement) Initializes the default WebDriver using theVerisoftDriverManager
and delegates the task to retrieves the shadow root element of a WebElement using JavaScript.default void
mouseHoverByJS
(String driverName, org.openqa.selenium.WebElement element) Simulates a mouse hover action on a web element using a WebDriver identified by its name.default void
mouseHoverByJS
(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement element) Main function that performs the actual mouse hover action on a web element using JavaScript.default void
mouseHoverByJS
(org.openqa.selenium.WebElement element) Simulates a mouse hover action on a web element using the default driver.default void
Opens a new browser tab using the default WebDriver.default void
openNewTab
(String driverName) Opens a new browser tab using a WebDriver identified by its name.default void
openNewTab
(org.openqa.selenium.WebDriver driver) Provides overloaded methods to open a new browser tab using JavaScript.default void
Opens a new browser tab and switches to it using the default WebDriver instance.default void
openNewTabAndSwitchToIt
(String driverName) Opens a new browser tab and switches to it using the specified WebDriver instance name.default void
openNewTabAndSwitchToIt
(org.openqa.selenium.WebDriver driver) Opens a new browser tab and switches to it using the provided WebDriver instance.
-
Field Details
-
timeout
static final int timeout
-
-
Method Details
-
clickOnElementByJS
default void clickOnElementByJS(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement element) Main function that performs the actual click on a web element using JavaScript. This is the core implementation, and all other overloaded methods delegate to it.- Parameters:
driver
- the WebDriver instance to use for executing the JavaScriptelement
- the WebElement to be clicked- Throws:
NullPointerException
- if the provided driver is null
-
clickOnElementByJS
default void clickOnElementByJS(org.openqa.selenium.WebElement element) This method is a convenient overload that uses the default WebDriver fromVerisoftDriverManager
. -
clickOnElementByJS
This method allows specifying a driver by its name. in scenarios where multiple drivers are managed dynamically. -
mouseHoverByJS
default void mouseHoverByJS(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement element) Main function that performs the actual mouse hover action on a web element using JavaScript. This is the core implementation, and all other overloaded methods delegate to it.- Parameters:
driver
- the WebDriver instance to use for executing the JavaScriptelement
- the WebElement on which to perform the mouse hover action- Throws:
NullPointerException
- if the provided driver is null
-
mouseHoverByJS
default void mouseHoverByJS(org.openqa.selenium.WebElement element) Simulates a mouse hover action on a web element using the default driver. This method is a convenient overload that uses the default WebDriver fromVerisoftDriverManager
. -
mouseHoverByJS
Simulates a mouse hover action on a web element using a WebDriver identified by its name. This method allows specifying a driver by its name. in scenarios where multiple drivers are managed dynamically. -
getBeforePseudoCode
default String getBeforePseudoCode(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement element) Main function that retrieves the RGB color of a pseudo-element from the WebElement using JavaScript. This is the core implementation, and all other overloaded methods delegate to it.- Parameters:
driver
- the WebDriver instance to use for executing the JavaScriptelement
- Webelement element- Returns:
- RGB(Red, Green, Blue)
- Throws:
NullPointerException
- if the provided driver is null
-
getBeforePseudoCode
Retrieves the RGB color of a pseudo-element from the WebElement using the default driver. This method is a convenient overload that uses the default WebDriver fromVerisoftDriverManager
. -
getBeforePseudoCode
Retrieves the RGB color of a pseudo-element from the WebElement using a WebDriver identified by its name. This method allows specifying a driver by its name. in scenarios where multiple drivers are managed dynamically. -
openNewTab
default void openNewTab(org.openqa.selenium.WebDriver driver) Provides overloaded methods to open a new browser tab using JavaScript. These methods offer flexibility in how the WebDriver is specified: -
openNewTab
default void openNewTab()Opens a new browser tab using the default WebDriver. -
openNewTab
Opens a new browser tab using a WebDriver identified by its name. -
getShadowRoot
default org.openqa.selenium.WebElement getShadowRoot(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement rootElement) Retrieves the shadow root element of a WebElement using JavaScript. This method accesses the shadow DOM of a given WebElement and returns the This is the core implementation, and all other overloaded methods delegate to it.- Parameters:
driver
- the WebDriver instance to use for executing the JavaScriptrootElement
- Root shadow element- Returns:
- return Shadow root element
-
getShadowRoot
default org.openqa.selenium.WebElement getShadowRoot(org.openqa.selenium.WebElement rootElement) Initializes the default WebDriver using theVerisoftDriverManager
and delegates the task to retrieves the shadow root element of a WebElement using JavaScript. -
getShadowRoot
default org.openqa.selenium.WebElement getShadowRoot(String driverName, org.openqa.selenium.WebElement rootElement) Initializes a WebDriver based on the provided driver name (String) and delegates the task to retrieves the shadow root element of a WebElement using JavaScript. -
getColorOfBeforeCssAtter
default String getColorOfBeforeCssAtter(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement element) This method accesses the shadow DOM of a given WebElement and returns the get css of ::before attribute- Parameters:
driver
- the WebDriver instance to use for executing the JavaScriptelement
- Webelement element- Returns:
- RGB(red, green, blue, blur)
-
getColorOfBeforeCssAtter
Initializes the default WebDriver using theVerisoftDriverManager
and delegates the task to given WebElement and returns the get css of ::before attribute -
getColorOfBeforeCssAtter
Initializes a WebDriver based on the provided driver name (String) and delegates the task to given WebElement and returns the get css of ::before attribute -
openNewTabAndSwitchToIt
default void openNewTabAndSwitchToIt(org.openqa.selenium.WebDriver driver) Opens a new browser tab and switches to it using the provided WebDriver instance.- Parameters:
driver
- the WebDriver instance used to perform the action
-
openNewTabAndSwitchToIt
default void openNewTabAndSwitchToIt()Opens a new browser tab and switches to it using the default WebDriver instance. -
openNewTabAndSwitchToIt
Opens a new browser tab and switches to it using the specified WebDriver instance name.
-