在 UIAutomation 中模拟绘图
我有一个应用程序,允许用户使用绘图功能写入某个区域,然后保存图像。有没有办法用 UIAutomation 来模拟这个?
I have an application that allows the user to write into an area using a drawing function and then save the image. Is there a way to emulate this with UIAutomation?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试使用内置函数dragFromToForDuration(from, to, timeout)。获取对象属性线origin.x和origin.y以及size.width和size.height,您将能够设置绘图的坐标。你甚至可以尝试画一些很棒的东西:)
这段代码将从绘图区域的左上角到右下角画一条线,持续 3 秒(至少我希望如此)。您可以更改超时参数以加快或减慢绘制速度。
您还可以尝试 flickInsideWithOptions (我不确定这个,但理论上是可能的)或 tapWithOptions() 来绘制一个点。
不幸的是,您只能使用此函数绘制线条。
Try to use build-in function dragFromToForDuration(from, to, timeout). Getting the object properties line origin.x and origin.y and size.width and size.height you will be able to set from and to coordinates for your drawing. You can even try to draw something awesome :)
This code will draw a line for 3 seconds from the top left corner to the bottom right corner of your drawing Area (at least I hope it will). You can change timeout parameter to draw faster or slower.
You can also try the flickInsideWithOptions (I'm not sure about this one but theoretically it is possible) or tapWithOptions() to draw a point.
Unfortunately you will be able to draw only lines using this functions.