如何自动单击 Flash 菜单上的按钮?
我希望能够以编程方式单击闪存菜单上的按钮。
不幸的是,这意味着切换到它或对按钮的 X 和 Y 坐标进行硬编码将不起作用(由于使用多个线程,这些方法在后台运行时都不起作用)。
我尝试使用 Javascript 执行此操作,但以这种方式实现自动化不起作用,因为在 Flash 中无法访问各个项目。
我问的原因是因为我正在尝试对我们的应用程序进行负载测试,该应用程序与闪存菜单交互以构建报告。据我所知,低端或开源负载测试实用程序在闪存导航方面没有提供太多支持。
有没有人有可能实现此目的的方法或替代解决方法?
I would like to be able to click a button on a flash menu, programmatically.
This means, unfortunately, that tabbing over to it or hard-coding the X and Y coordinates of the button will not work (due to using multiple threads, neither of these approaches works while running in the background).
I tried doing this with Javascript, but automating it that way does not work because the individual items are inaccessible in Flash.
The reason I'm asking is because I'm attempting to load-test our application which interacts with a flash menu in order to build a report. From what I can tell, the low-end or open-source load-testing utilities don't offer much support in the way of flash navigation.
Does anyone have an approach that might accomplish this, or an alternative workaround?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您正在测试自己的应用程序,则可以通过
ExternalInterface
构建测试 API,您可以直接从 JavaScript 调用该 API。让 API 和 Button 调用相同的方法,这样您只需调用 swf 的已发布外部接口上的方法即可有效地单击按钮。If you're testing your own application then build in a testing API through
ExternalInterface
which you can call from JavaScript directly. Make the API and Button call the same method so you can effectively click the button simply by calling a method on the published external interface for your swf.