public class PageHelper extends Object
| Constructor and Description |
|---|
PageHelper() |
| Modifier and Type | Method and Description |
|---|---|
String |
acceptAlert()
accepts alert by selecting ok or cancel
|
void |
bringPageToFront()
brings current browser to front
|
void |
CloseAndReturn(String defaultWindow)
close the window And return to the defaultWindow
|
String |
currentWindow()
return the current window handle
|
void |
deleteAllCookies()
delete all cookies
|
void |
deleteCookieNamed(String name)
delete cookie named
|
String |
dimissAlert()
dismisses alert by selecting ok or cancel
|
String |
getAlertValue()
returns alert message value
|
String |
getClipboardData()
retrieves the clip board data
|
String |
getCurrentUrl()
returns the current url
|
String |
getPageSource()
gets page source
|
String |
getPageTitle()
returns the title of the page
|
Boolean |
isVisibleInViewport(EnhancedBy by)
returns true if the element is visible in the current page only for web
applications
|
Boolean |
isVisibleInViewport(EnhancedBy by,
int index)
returns true if the element is visible in the current page only for web
applications
|
void |
maximizePage()
maximizes web page
|
void |
navigateBack()
navigates back
|
void |
navigateForward()
navigate forward
|
void |
navigateToUrl(String url)
navigate to a different url
|
void |
quitAllCurrentTestDrivers()
quits all drivers in the current test
|
void |
quitCurrentDriver()
quits the current web driver
|
void |
quitDriver(org.openqa.selenium.WebDriver driver)
quit driver
|
void |
refreshPage()
reload page
|
void |
refreshPageSource()
gets page source
|
void |
setPageSize(int x,
int y)
sets page size
|
void |
switchDriver(org.openqa.selenium.WebDriver driver)
switch webdriver use for switching between different drivers
|
void |
switchIframe(EnhancedBy frame)
switches frame to frame specified
|
void |
switchToDefaultFrame()
switches to default frame
|
void |
switchToNewWindow(String defaultWindow)
switch to the new opened window
|
void |
switchToNextTab()
switch to next tab circles back to initial tab if it reaches the last tab
|
void |
switchToPreviousTab()
switch to previous tab circle back to the last tab
|
void |
switchToTab(int index)
switch to tab by index
|
static void |
switchWindowHandle(int index)
switch windows handle based on index
|
void |
swtichUrl(String url)
navigate to a different url
|
void |
verifyNumberOfTabs(int tabs)
switch to tab by index
|
void |
verifyTitle(String appTitle)
verify page title
|
public void maximizePage()
public void setPageSize(int x,
int y)
x - y - public void refreshPage()
public void switchIframe(EnhancedBy frame)
frame - public void switchToDefaultFrame()
public static void switchWindowHandle(int index)
index - public String dimissAlert()
alert - public String acceptAlert()
alert - public String getAlertValue()
public String currentWindow()
public void switchToNewWindow(String defaultWindow)
defaultWindow - public void CloseAndReturn(String defaultWindow)
defaultWindow - public void refreshPageSource()
public void verifyTitle(String appTitle)
appTitle - public void switchDriver(org.openqa.selenium.WebDriver driver)
driver - public void switchToNextTab()
public void switchToPreviousTab()
public void switchToTab(int index)
public void verifyNumberOfTabs(int tabs)
public String getPageTitle()
public String getCurrentUrl()
public String getPageSource()
public void navigateBack()
public void navigateForward()
public void deleteAllCookies()
public void deleteCookieNamed(String name)
name - public void bringPageToFront()
public void swtichUrl(String url)
url - destination urlpublic void navigateToUrl(String url)
url - destination urlpublic String getClipboardData()
public void quitCurrentDriver()
public void quitDriver(org.openqa.selenium.WebDriver driver)
driver - public void quitAllCurrentTestDrivers()
public Boolean isVisibleInViewport(EnhancedBy by)
by - public Boolean isVisibleInViewport(EnhancedBy by, int index)
by - Copyright © 2020. All rights reserved.