public class Utilities extends Object
Constructor and Description |
---|
Utilities() |
Modifier and Type | Method and Description |
---|---|
File |
evaluateFileFromResourceDirectory(String fileName)
Utility to load a file from the resource directory
|
void |
waitForElementPresent(org.openqa.selenium.WebDriver driver,
List<org.openqa.selenium.WebElement> elements)
Util method to wait for the List of elements to be present on the page.
|
void |
waitForElementPresent(org.openqa.selenium.WebDriver driver,
List<org.openqa.selenium.WebElement> elements,
long timeout)
Util method to wait for the List of elements to be present on the page.
|
void |
waitForElementPresent(org.openqa.selenium.WebDriver driver,
org.openqa.selenium.WebElement element)
Util method to wait for the element to be present on the page.
|
void |
waitForElementPresent(org.openqa.selenium.WebDriver driver,
org.openqa.selenium.WebElement element,
long timeout)
Util method to wait for the element to be present on the page.
|
void |
waitForElementToBeVisible(org.openqa.selenium.WebDriver driver,
org.openqa.selenium.WebElement element)
Util method to wait for the element to be visible on the page.
|
void |
waitForElementToBeVisible(org.openqa.selenium.WebDriver driver,
org.openqa.selenium.WebElement element,
long timeout)
Util method to wait for the element to be visible on the page.
|
void |
waitForPage(Browser browser,
Class<?> pageClass)
Util method for waiting for the page object model page to appear or displayed.
|
void |
waitForPage(Browser browser,
Class<?> pageClass,
long timeout)
Util method for waiting for the page object model page to appear or displayed.
|
public void waitForElementPresent(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement element)
driver
- WebDriver
object. This object is not used by the method but as WebDriverWait
class
needs it, it have to be provided.element
- WebElement
object of the element that we have to wait for to be present.public void waitForElementPresent(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement element, long timeout)
driver
- WebDriver
object. This object is not used by the method but as WebDriverWait
class
needs it, it have to be provided.element
- WebElement
object of the element that we have to wait for to be present.timeout
- Time to wait for.public void waitForElementPresent(org.openqa.selenium.WebDriver driver, List<org.openqa.selenium.WebElement> elements)
driver
- WebDriver
object. This object is not used by the method but as WebDriverWait
class
needs it, it have to be provided.elements
- List
of WebElement
object of elements that we have to wait for to be present.public void waitForElementPresent(org.openqa.selenium.WebDriver driver, List<org.openqa.selenium.WebElement> elements, long timeout)
driver
- WebDriver
object. This object is not used by the method but as WebDriverWait
class
needs it, it have to be provided.elements
- List
of WebElement
object of elements that we have to wait for to be present.timeout
- Time to wait for.public void waitForElementToBeVisible(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement element)
driver
- WebDriver
object. This object is not used by the method but as WebDriverWait
class
needs it, it have to be provided.element
- WebElement
object that we have to wait for to be visible.public void waitForElementToBeVisible(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement element, long timeout)
driver
- WebDriver
object. This object is not used by the method but as WebDriverWait
class
needs it, it have to be provided.element
- WebElement
object that we have to wait for to be visible.timeout
- Time to wait for.public void waitForPage(Browser browser, Class<?> pageClass, long timeout)
PageClass.at()
method implemented by the implementing Page Object class.browser
- Browser object of the current page or test class from where this method is call'dpageClass
- Page class extending PageClass
for which WebDriver
should wait.timeout
- Time to wait for.public void waitForPage(Browser browser, Class<?> pageClass)
PageClass.at()
method implemented by the implementing Page Object class.
Uses default timeout of 60 sec.browser
- Browser object of the current page or test class from where this method is call'dpageClass
- Page class extending PageClass
for which WebDriver
should wait.Copyright © 2014. All rights reserved.