空手道机器人:如何滚动浏览datagrid元素?

发布于 2025-01-27 08:48:22 字数 240 浏览 1 评论 0 原文

我一直在使用空手道框架机器人组件进行桌面UI自动化。有了它,我需要单击数据网格的每个行中的一个按钮,然后使用 consck()在不在视图/不在屏幕上时不起作用。因此,我试图弄清楚如何向下滚动到所需的项目,以便可以单击按钮。我注意到驱动程序可以选择 scroll(),但我找不到带有机器人的选项。

是否有解决方法,或者是否有计划在将来为空手道机器人添加 scroll()函数?

I have been using the Karate framework Robot component for desktop UI automation. With it, I need to click on a button in each row item of a data grid and using click() doesn't work when the item is not in view/is offscreen. As such I'm trying to figure out how to scroll down to the items I need so I can click the button. I noticed with the driver there is an option to scroll() but I haven't been able to find one with Robot.

Is there a workaround for this or are there plans to add a scroll() function for karate-robot in the future?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

柒七 2025-02-03 08:48:22

滚动肯定听起来像是现有的API可能缺少它。请考虑调查并为代码做出贡献,这将使发布速度更快。

同时,这是可能的解决方法:

  • 如果您获得对按钮的引用,请查看是否使用Tab键自动滚动到该元素
  • ,可以调用 Invoke(), 由a

PS请考虑贡献代码,代码库实际上很简单。在这里您可以在这里实现 scroll 模式: link

Scroll certainly sounds like it may be missing from the existing API. Please do consider investigating and contributing to the code, which will just make it faster to release.

Meanwhile here are the possible workarounds:

  • see if using the TAB key auto-scrolls to the element
  • if you get a reference to the button you can call invoke() on it which is supported by a range of windows components

P.S. please do consider contributing code, the code base is actually quite simple. And here is where you can implement the Scroll pattern: link.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文