public class EyesSeleniumDriver extends EyesWebDriver implements org.openqa.selenium.interactions.HasInputDevices, org.openqa.selenium.interactions.HasTouchScreen, com.applitools.eyes.IEyesJsExecutor
RemoteWebDriver
.
Used so we'll be able to return the users an object with the same
functionality as RemoteWebDriver
.org.openqa.selenium.WebDriver.ImeHandler, org.openqa.selenium.WebDriver.Navigation, org.openqa.selenium.WebDriver.Options, org.openqa.selenium.WebDriver.TargetLocator, org.openqa.selenium.WebDriver.Timeouts, org.openqa.selenium.WebDriver.Window
logger
Constructor and Description |
---|
EyesSeleniumDriver(com.applitools.eyes.Logger logger,
SeleniumEyes eyes,
org.openqa.selenium.remote.RemoteWebDriver driver) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
Object |
executeAsyncScript(String script,
Object... args) |
Object |
executeScript(String script,
Object... args) |
org.openqa.selenium.WebElement |
findElement(org.openqa.selenium.By by) |
org.openqa.selenium.WebElement |
findElementByClassName(String className) |
org.openqa.selenium.WebElement |
findElementByCssSelector(String cssSelector) |
org.openqa.selenium.WebElement |
findElementById(String id) |
org.openqa.selenium.WebElement |
findElementByLinkText(String linkText) |
org.openqa.selenium.WebElement |
findElementByName(String name) |
org.openqa.selenium.WebElement |
findElementByPartialLinkText(String partialLinkText) |
org.openqa.selenium.WebElement |
findElementByTagName(String tagName) |
org.openqa.selenium.WebElement |
findElementByXPath(String path) |
List<org.openqa.selenium.WebElement> |
findElements(org.openqa.selenium.By by) |
List<org.openqa.selenium.WebElement> |
findElementsByClassName(String className) |
List<org.openqa.selenium.WebElement> |
findElementsByCssSelector(String cssSelector) |
List<org.openqa.selenium.WebElement> |
findElementsById(String id) |
List<org.openqa.selenium.WebElement> |
findElementsByLinkText(String linkText) |
List<org.openqa.selenium.WebElement> |
findElementsByName(String name) |
List<org.openqa.selenium.WebElement> |
findElementsByPartialLinkText(String partialLinkText) |
List<org.openqa.selenium.WebElement> |
findElementsByTagName(String tagName) |
List<org.openqa.selenium.WebElement> |
findElementsByXPath(String path) |
void |
get(String s) |
org.openqa.selenium.Capabilities |
getCapabilities() |
String |
getCurrentUrl() |
com.applitools.eyes.RectangleSize |
getDefaultContentViewportSize()
|
com.applitools.eyes.RectangleSize |
getDefaultContentViewportSize(boolean forceQuery) |
protected double |
getDevicePixelRatioInner() |
Map<String,org.openqa.selenium.WebElement> |
getElementIds()
Found elements are sometimes accessed by their IDs (e.g.
|
SeleniumEyes |
getEyes() |
FrameChain |
getFrameChain() |
long |
getInnerWidth() |
org.openqa.selenium.interactions.Keyboard |
getKeyboard() |
org.openqa.selenium.interactions.Mouse |
getMouse() |
String |
getPageSource() |
org.openqa.selenium.remote.RemoteWebDriver |
getRemoteWebDriver() |
ImageRotation |
getRotation() |
<X> X |
getScreenshotAs(org.openqa.selenium.OutputType<X> xOutputType) |
String |
getTitle() |
org.openqa.selenium.interactions.TouchScreen |
getTouch() |
String |
getUserAgent() |
String |
getWindowHandle() |
Set<String> |
getWindowHandles() |
org.openqa.selenium.WebDriver.Options |
manage() |
org.openqa.selenium.WebDriver.Navigation |
navigate() |
static BufferedImage |
normalizeRotation(com.applitools.eyes.Logger logger,
org.openqa.selenium.WebDriver driver,
BufferedImage image,
ImageRotation rotation)
Rotates the image as necessary.
|
void |
quit() |
void |
setRotation(ImageRotation rotation) |
org.openqa.selenium.WebDriver.TargetLocator |
switchTo() |
getDevicePixelRatio, getEyesBase, getTestId
public EyesSeleniumDriver(com.applitools.eyes.Logger logger, SeleniumEyes eyes, org.openqa.selenium.remote.RemoteWebDriver driver) throws com.applitools.eyes.EyesException
com.applitools.eyes.EyesException
public static BufferedImage normalizeRotation(com.applitools.eyes.Logger logger, org.openqa.selenium.WebDriver driver, BufferedImage image, ImageRotation rotation)
driver
- The underlying driver which produced the screenshot.image
- The image to normalize.rotation
- The degrees by which to rotate the image:
positive values = clockwise rotation,
negative values = counter-clockwise,
0 = force no rotation,
null = rotate automatically as needed.logger
- loggerpublic SeleniumEyes getEyes()
public org.openqa.selenium.remote.RemoteWebDriver getRemoteWebDriver()
getRemoteWebDriver
in class EyesWebDriver
public org.openqa.selenium.interactions.TouchScreen getTouch()
getTouch
in interface org.openqa.selenium.interactions.HasTouchScreen
public ImageRotation getRotation()
public void setRotation(ImageRotation rotation)
rotation
- The image rotation model.public void get(String s)
get
in interface org.openqa.selenium.WebDriver
public String getCurrentUrl()
getCurrentUrl
in interface org.openqa.selenium.WebDriver
public String getTitle()
getTitle
in interface org.openqa.selenium.WebDriver
public List<org.openqa.selenium.WebElement> findElements(org.openqa.selenium.By by)
findElements
in interface org.openqa.selenium.SearchContext
findElements
in interface org.openqa.selenium.WebDriver
findElements
in class EyesWebDriver
protected double getDevicePixelRatioInner()
getDevicePixelRatioInner
in class EyesWebDriver
public org.openqa.selenium.WebElement findElement(org.openqa.selenium.By by)
findElement
in interface org.openqa.selenium.SearchContext
findElement
in interface org.openqa.selenium.WebDriver
findElement
in class EyesWebDriver
public Map<String,org.openqa.selenium.WebElement> getElementIds()
public String getPageSource()
getPageSource
in interface org.openqa.selenium.WebDriver
public void close()
close
in interface org.openqa.selenium.WebDriver
public void quit()
quit
in interface org.openqa.selenium.WebDriver
public Set<String> getWindowHandles()
getWindowHandles
in interface org.openqa.selenium.WebDriver
public String getWindowHandle()
getWindowHandle
in interface org.openqa.selenium.WebDriver
public org.openqa.selenium.WebDriver.TargetLocator switchTo()
switchTo
in interface org.openqa.selenium.WebDriver
public org.openqa.selenium.WebDriver.Navigation navigate()
navigate
in interface org.openqa.selenium.WebDriver
public org.openqa.selenium.WebDriver.Options manage()
manage
in interface org.openqa.selenium.WebDriver
public org.openqa.selenium.interactions.Mouse getMouse()
getMouse
in interface org.openqa.selenium.interactions.HasInputDevices
public org.openqa.selenium.interactions.Keyboard getKeyboard()
getKeyboard
in interface org.openqa.selenium.interactions.HasInputDevices
public org.openqa.selenium.WebElement findElementByClassName(String className)
public List<org.openqa.selenium.WebElement> findElementsByClassName(String className)
public org.openqa.selenium.WebElement findElementByCssSelector(String cssSelector)
public List<org.openqa.selenium.WebElement> findElementsByCssSelector(String cssSelector)
public org.openqa.selenium.WebElement findElementById(String id)
public org.openqa.selenium.WebElement findElementByLinkText(String linkText)
public List<org.openqa.selenium.WebElement> findElementsByLinkText(String linkText)
public org.openqa.selenium.WebElement findElementByPartialLinkText(String partialLinkText)
public List<org.openqa.selenium.WebElement> findElementsByPartialLinkText(String partialLinkText)
public org.openqa.selenium.WebElement findElementByName(String name)
public org.openqa.selenium.WebElement findElementByTagName(String tagName)
public List<org.openqa.selenium.WebElement> findElementsByTagName(String tagName)
public org.openqa.selenium.WebElement findElementByXPath(String path)
public org.openqa.selenium.Capabilities getCapabilities()
getCapabilities
in interface org.openqa.selenium.HasCapabilities
public Object executeScript(String script, Object... args)
executeScript
in interface com.applitools.eyes.IEyesJsExecutor
executeScript
in interface org.openqa.selenium.JavascriptExecutor
public Object executeAsyncScript(String script, Object... args)
executeAsyncScript
in interface org.openqa.selenium.JavascriptExecutor
public com.applitools.eyes.RectangleSize getDefaultContentViewportSize(boolean forceQuery)
forceQuery
- If true, we will perform the query even if we have a cached viewport size.public com.applitools.eyes.RectangleSize getDefaultContentViewportSize()
public FrameChain getFrameChain()
public <X> X getScreenshotAs(org.openqa.selenium.OutputType<X> xOutputType) throws org.openqa.selenium.WebDriverException
getScreenshotAs
in interface org.openqa.selenium.TakesScreenshot
org.openqa.selenium.WebDriverException
public String getUserAgent()
public long getInnerWidth()
Copyright © 2022. All rights reserved.