src/main/java/com/xceptance/neodymium/util/SelenideAddons.java
/**
     * Drag and drop an element to a given position. The position will be set by the user. It drags the element and
     * moves it to a specific position of the respective slider.
     * 
     * @param elementToMove
     *            The selector of the slider to drag and drop
     * @param elementToCheck
     *            The locator of the slider value
     * @param horizontalMovement
     *            The offset for the horizontal movement
     * @param verticalMovement
     *            The offset for the vertical movement
     * @param pauseBetweenMovements
     *            Time to pass after the slider do the next movement step
     * @param retryMovements
     *            Amount of retries the slider will be moved
     * @param condition
     *            The condition for the slider to verify the movement
     */
Drag and drop an element to a given position. The position will be set by the user. It drags the element and
moves it to a specific position of the respective slider.


Drag and drop an element to a given position . The position will be set by the user . It drags the element and moves it to a specific position of the respective slider .
public static void dragAndDropUntilCondition(SelenideElement elementToMove, SelenideElement elementToCheck, int horizontalMovement, int verticalMovement,
                                                 int pauseBetweenMovements, int retryMovements, Condition condition)
    {
        int counter = 0;
        while (!elementToCheck.has(condition))
        {
            if (counter > retryMovements)
            {
                SelenideAddons.wrapAssertionError(() -> {
                    Assert.assertTrue("CircutBreaker: Was not able to move the element and to reach the condition. Tried: " + retryMovements
                                      + " times to move the element.", false);
                });
            }
            dragAndDrop(elementToMove, horizontalMovement, verticalMovement);
            sleep(pauseBetweenMovements);
            counter++;
        }
    }
public static void dragAndDropUntilCondition ( SelenideElement elementToMove , SelenideElement elementToCheck , int horizontalMovement , int verticalMovement , int pauseBetweenMovements , int retryMovements , Condition condition ) { int counter = 0 ; while ( ! elementToCheck . has ( condition ) ) { if ( counter > retryMovements ) { SelenideAddons . wrapAssertionError ( ( ) -> { Assert . assertTrue ( "CircutBreaker: Was not able to move the element and to reach the condition. Tried: " + retryMovements + " times to move the element." , false ) ; } ) ; } dragAndDrop ( elementToMove , horizontalMovement , verticalMovement ) ; sleep ( pauseBetweenMovements ) ; counter ++ ; } }
Drag and drop an element to a given position.
Drag and drop an element to a given position .