Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scrolling on The Page #229

Open
dsa45632 opened this issue Dec 3, 2023 · 4 comments
Open

Scrolling on The Page #229

dsa45632 opened this issue Dec 3, 2023 · 4 comments

Comments

@dsa45632
Copy link

dsa45632 commented Dec 3, 2023

Warning:
I am following this to make scrolling on the page https://github.com/appium/appium-windows-driver#windows-scroll. But whatever I do I keep getting unknown server-side issues, I am just trying to scroll down and up on the page . I see element id or x and y coordinates must be provided but If I am doing scrolling through the page I believe I don't need those coordinates right? anyway if I do I still get an issue.
Here is my logic

1- Map<String, Object> params = new HashMap<>();
// // params.put("elementId", startElementId);
params.put("x", 100);
params.put("y", 100);

 params.put("deltaY", 100);


    windowsDriver.get().executeScript("windows:scroll", params);
}

if I put element id there and take off x and y coordinates I still get issues , I tried to put ms duration time as well but that does not change anything still same issue,
Any suggestions please?

@mykola-mokhnach
Copy link

mykola-mokhnach commented Dec 4, 2023

This endpoint actually emulates the vertical or horizontal rotation of the mouse wheel. So, make sure you can scroll the given element at the given coordinate manually. Also verify if it needs to have the focus to be able to scroll.

@dsa45632
Copy link
Author

I have tried that but It did not work, is there any examples I can refer too please?

@mykola-mokhnach
Copy link

What if you increase deltaY by multiplying it to 120?

The documentation to this API says

If dwFlags contains MOUSEEVENTF_WHEEL, then mouseData specifies the amount of wheel movement. A positive value indicates that the wheel was rotated forward, away from the user; a negative value indicates that the wheel was rotated backward, toward the user. One wheel click is defined as WHEEL_DELTA, which is 120.

@mastafungus
Copy link

I have the same issue.
I've tried to increase deltaY by multiplying it to 120 without success. My test PASS but no scrolling.

def windows_scrolling(locator):
    # Get the Appium driver instance
    appium_lib = BuiltIn().get_library_instance('AppiumLibrary')
    driver = appium_lib._current_application()

    # Find the element
    element = locator_to_element(locator, driver)

    # Get the element's coordinates
    x = element.location['x']
    y = element.location['y']

    # Log the coordinates
    BuiltIn().log(f"Scrolling to the element at coordinates ({x}, {y})")

    # Scroll down
    driver.execute_script('windows: scroll', {'x': x, 'y': y, 'deltaY': -360})

Appium windows driver : 2.12.16

Any suggestions ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants