使用 WinAppDriver 单击坐标

问题描述 投票:0回答:1

我有一个 Windows 应用程序,我必须使用 WinAppDriver 和 Appium 在远程计算机上测试它。

在测试过程中,我需要单击屏幕的特定点。 我尝试了多种方法,但都不起作用。

有什么办法我可以做到这一点吗?!

c# appium winappdriver
1个回答
0
投票

使用 IWebElement 扩展尝试下一个代码。它正在本地工作。

public static IWebElement ClickByPoints(this IWebElement element, Point point)
{
    public static void ClickByPoints(this IWebElement element, Point point)
{
    new Actions(((IWrapsDriver)element).WrappedDriver).MoveToElement(element, 0, 0).MoveByOffset(point.X, point.Y).Click()
        .Perform();
}
© www.soinside.com 2019 - 2024. All rights reserved.