public class WindowAction
extends java.lang.Object
| Constructor and Description |
|---|
WindowAction(FluentControl control,
ComponentInstantiator instantiator,
org.openqa.selenium.WebDriver driver)
Creates a new window action.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clickAndCloseCurrent(FluentWebElement button)
Clicks button, which closes current window and switches to last window (in set returned by
WebDriver.getWindowHandles()). |
java.lang.String |
clickAndOpenNew(FluentWebElement button)
Clicks button, which opens new window and switches to newly opened window.
|
void |
close()
Close the current window.
|
WindowAction |
fullscreen()
FullScreen the current window.
|
org.openqa.selenium.Point |
getPosition()
Gets the current window position.
|
org.openqa.selenium.Dimension |
getSize()
Gets the current window size.
|
org.openqa.selenium.WebDriver.Window |
getWindow()
Gets the current window object.
|
WindowAction |
maximize()
Maximize the current window.
|
java.lang.String |
openNewAndSwitch()
Opens new window.
|
WindowAction |
setPosition(org.openqa.selenium.Point position)
Sets the current window position.
|
WindowAction |
setSize(org.openqa.selenium.Dimension size)
Sets the current window size.
|
FluentTargetLocator<WindowAction> |
switchTo()
Create a switch target locator.
|
WindowAction |
switchTo(java.lang.String nameOrHandle)
Switches to particular window by handle.
|
WindowAction |
switchToLast()
Switches to lastly opened window.
|
WindowAction |
switchToLast(java.lang.String nameOrHandleToExclude)
Switches to lastly opened window excluding the one provided as a parameter.
|
java.lang.String |
title()
Gets the page title.
|
public WindowAction(FluentControl control, ComponentInstantiator instantiator, org.openqa.selenium.WebDriver driver)
control - control interfaceinstantiator - component instantiatordriver - selenium driverpublic java.lang.String title()
public WindowAction maximize()
public WindowAction fullscreen()
public WindowAction setSize(org.openqa.selenium.Dimension size)
size - size of the windowpublic org.openqa.selenium.Dimension getSize()
public WindowAction setPosition(org.openqa.selenium.Point position)
position - position to setpublic org.openqa.selenium.Point getPosition()
public java.lang.String clickAndOpenNew(FluentWebElement button)
This method doesn't force opening window in new window, we assume the code under test will open new window.
button - button to be clickedpublic java.lang.String openNewAndSwitch()
public void clickAndCloseCurrent(FluentWebElement button)
WebDriver.getWindowHandles()).
If the last window is not the target window, use switchTo(String)
to focus on desired window
button - button to be clickedpublic void close()
public FluentTargetLocator<WindowAction> switchTo()
public WindowAction switchToLast()
public WindowAction switchToLast(java.lang.String nameOrHandleToExclude)
nameOrHandleToExclude - if list size is greater than one it will be removedpublic WindowAction switchTo(java.lang.String nameOrHandle)
nameOrHandle - window name or handlepublic org.openqa.selenium.WebDriver.Window getWindow()
Copyright © 2018 FluentLenium. All Rights Reserved.