Package org.fluentlenium.core.action
Class MouseElementActions
- java.lang.Object
-
- org.fluentlenium.core.action.MouseElementActions
-
public class MouseElementActions extends java.lang.ObjectElement specific mouse control interface.
-
-
Constructor Summary
Constructors Constructor Description MouseElementActions(org.openqa.selenium.WebDriver driver, FluentWebElement fluentWebElement)Creates a new mouse element actions.MouseElementActions(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement element)Creates a new mouse element actions.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description org.openqa.selenium.interactions.Mousebasic()Deprecated.Use the following mapping for updating your code:MouseElementActionsclick()Clicks in the middle of the given element.MouseElementActionsclickAndHold()Clicks (without releasing) in the middle of the given element.MouseElementActionscontextClick()Performs a context-click at middle of the given element.MouseElementActionsdoubleClick()Performs a double-click at middle of the given element.MouseElementActionsdragAndDropBy(int xOffset, int yOffset)A convenience method that performs click-and-hold at the location of this element, moves by a given offset, then releases the mouse.MouseElementActionsdragAndDropByWithTargetOffset(org.openqa.selenium.WebElement target, int xOffset, int yOffset)A convenience method that performs click-and-hold at the location of this element, moves by a given offset of target element, then releases the mouse.MouseElementActionsdragAndDropFrom(org.openqa.selenium.WebElement source)A convenience method that performs click-and-hold at the location of the source element, moves to the location of this element (target), then releases the mouse.MouseElementActionsdragAndDropTo(org.openqa.selenium.WebElement target)A convenience method that performs click-and-hold at the location of this element (source), moves to the location of the target element, then releases the mouse.MouseElementActionsmoveToElement()Moves the mouse to the middle of the element.MouseElementActionsmoveToElement(int xOffset, int yOffset)Moves the mouse to an offset from the top-left corner of the element.MouseElementActionsmoveToElement(org.openqa.selenium.WebElement target)Moves the mouse to the middle of the target element.MouseElementActionsmoveToElement(org.openqa.selenium.WebElement target, int xOffset, int yOffset)Moves the mouse to an offset from the top-left corner of the target element.MouseElementActionsrelease()Releases the depressed left mouse button, in the middle of the given element.
-
-
-
Constructor Detail
-
MouseElementActions
public MouseElementActions(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement element)Creates a new mouse element actions.- Parameters:
driver- selenium driverelement- selenium element
-
MouseElementActions
public MouseElementActions(org.openqa.selenium.WebDriver driver, FluentWebElement fluentWebElement)Creates a new mouse element actions.- Parameters:
driver- selenium driverfluentWebElement- FluentWebElement
-
-
Method Detail
-
basic
@Deprecated public org.openqa.selenium.interactions.Mouse basic()
Deprecated.Use the following mapping for updating your code:Mouse.click(Coordinates)toclick()Mouse.doubleClick(Coordinates)todoubleClick()Mouse.mouseDown(Coordinates)tomoveToElement()thenclickAndHold()Mouse.mouseUp(Coordinates)torelease()Mouse.mouseMove(Coordinates)tomoveToElement()Mouse.mouseMove(Coordinates, long, long)tomoveToElement(int, int)Mouse.contextClick(Coordinates)tocontextClick()Basic mouse operations- Returns:
- low level interface to control the mouse
-
clickAndHold
public MouseElementActions clickAndHold()
Clicks (without releasing) in the middle of the given element. This is equivalent to: Actions.moveToElement(onElement).clickAndHold()- Returns:
- this object reference to chain calls
- See Also:
Actions.clickAndHold(WebElement)
-
release
public MouseElementActions release()
Releases the depressed left mouse button, in the middle of the given element. This is equivalent to: Actions.moveToElement(onElement).release()Invoking this action without invoking
clickAndHold()first will result in undefined behaviour.- Returns:
- this object reference to chain calls
- See Also:
Actions.release(WebElement)
-
click
public MouseElementActions click()
Clicks in the middle of the given element. Equivalent to: Actions.moveToElement(onElement).click()- Returns:
- this object reference to chain calls
- See Also:
Actions.click(WebElement)
-
doubleClick
public MouseElementActions doubleClick()
Performs a double-click at middle of the given element. Equivalent to: Actions.moveToElement(element).doubleClick()- Returns:
- this object reference to chain calls
- See Also:
Actions.doubleClick(WebElement)
-
moveToElement
public MouseElementActions moveToElement()
Moves the mouse to the middle of the element. The element is scrolled into view and its location is calculated using getBoundingClientRect.- Returns:
- this object reference to chain calls
- See Also:
Actions.moveToElement(WebElement)
-
moveToElement
public MouseElementActions moveToElement(org.openqa.selenium.WebElement target)
Moves the mouse to the middle of the target element. The element is scrolled into view and its location is calculated using getBoundingClientRect.- Parameters:
target- element to move to and release the mouse at.- Returns:
- this object reference to chain calls
- See Also:
Actions.moveToElement(WebElement)
-
moveToElement
public MouseElementActions moveToElement(int xOffset, int yOffset)
Moves the mouse to an offset from the top-left corner of the element. The element is scrolled into view and its location is calculated using getBoundingClientRect.- Parameters:
xOffset- Offset from the top-left corner. A negative value means coordinates left from the elementyOffset- Offset from the top-left corner. A negative value means coordinates above the element- Returns:
- this object reference to chain calls
- See Also:
Actions.moveToElement(WebElement, int, int)
-
moveToElement
public MouseElementActions moveToElement(org.openqa.selenium.WebElement target, int xOffset, int yOffset)
Moves the mouse to an offset from the top-left corner of the target element. The element is scrolled into view and its location is calculated using getBoundingClientRect.- Parameters:
target- element to move to and release the mouse at.xOffset- Offset from the top-left corner. A negative value means coordinates left from the elementyOffset- Offset from the top-left corner. A negative value means coordinates above the element- Returns:
- this object reference to chain calls
- See Also:
Actions.moveToElement(WebElement, int, int)
-
contextClick
public MouseElementActions contextClick()
Performs a context-click at middle of the given element. First performs a mouseMove to the location of the element.- Returns:
- this object reference to chain calls
- See Also:
Actions.contextClick(WebElement)
-
dragAndDropFrom
public MouseElementActions dragAndDropFrom(org.openqa.selenium.WebElement source)
A convenience method that performs click-and-hold at the location of the source element, moves to the location of this element (target), then releases the mouse.- Parameters:
source- element to emulate button down at- Returns:
- this object reference to chain calls
- See Also:
Actions.dragAndDrop(WebElement, WebElement)
-
dragAndDropTo
public MouseElementActions dragAndDropTo(org.openqa.selenium.WebElement target)
A convenience method that performs click-and-hold at the location of this element (source), moves to the location of the target element, then releases the mouse.- Parameters:
target- element to move to and release the mouse at.- Returns:
- this object reference to chain calls
- See Also:
Actions.dragAndDrop(WebElement, WebElement)
-
dragAndDropBy
public MouseElementActions dragAndDropBy(int xOffset, int yOffset)
A convenience method that performs click-and-hold at the location of this element, moves by a given offset, then releases the mouse.- Parameters:
xOffset- horizontal move offset.yOffset- vertical move offset.- Returns:
- this object reference to chain calls
- See Also:
Actions.dragAndDropBy(WebElement, int, int)
-
dragAndDropByWithTargetOffset
public MouseElementActions dragAndDropByWithTargetOffset(org.openqa.selenium.WebElement target, int xOffset, int yOffset)
A convenience method that performs click-and-hold at the location of this element, moves by a given offset of target element, then releases the mouse. This Method is not available in pure Selenium- Parameters:
target- element to move to and release the mouse at.xOffset- horizontal move offset.yOffset- vertical move offset.- Returns:
- this object reference to chain calls
- See Also:
Actions.dragAndDropBy(WebElement, int, int)
-
-