在 QTP 中测试飞出菜单 [英] Testing Fly Out Menu in QTP
问题描述
我正在寻找使用 QTP 触发弹出式菜单操作的想法.
I am looking for ideas to trigger the actions for fly-out menus using QTP.
我正在使用 QTP 测试 Web 应用程序.该应用程序具有级联"或分层弹出菜单.
I am testing a Web App using QTP. The application has "cascaded" or hierarchical fly-out menu.
例如Options->Preferences
重新编码时 QTP 会识别菜单层次结构上的终点(比如首选项").但是在运行测试时,触发 WebElement("Preferences").Click
不起作用.
While recoding QTP recognizes the end point on the Menu hierarchy (say "Preferences").
But while running the test, firing the WebElement("Preferences").Click
does not work.
如果我调用 Link("Options").FireEvent ("onmouseover")
它会下拉菜单,然后我可以突出显示首选项项目,但即使在下拉后也调用单击菜单未能触发菜单操作.
If I call Link("Options").FireEvent ("onmouseover")
it pulls down the Menu, and after that I can highlight the Preferences item, but calling the click even after pulling down the menu fails to trigger the menu action.
任何触发这些菜单项上的点击操作的想法都会很有用.
Any Ideas to trigger the click action on these menu items would be useful.
问候,
阿达莎
推荐答案
由于在 QTP 执行时失去了多任务处理能力,我没有按照 Motti 的建议实施.因此,我最终通过 HTML 代码查看 java 脚本预期哪些鼠标事件.结果我需要调用以下序列:
For the reason of loosing multitasking while QTP is executing, I did not implement with Motti's suggesiton. So instaed I ended up going through the HTML code to see which mouse events are expected by the java script. It turns out i need to call the below sequences:
Link("Options").FireEvent ("onmouseover")
WebElement("Preferences").FireEvent ("onmouseover")
WebElement("Preferences").FireEvent ("onClick")
这个技巧真的很好用,但这里的风险是如果他们彻底改变任何事情(比如如果他们使用 onMouseDown 则改为单击)我需要调整测试脚本.
This trick works really nice, but the risk here is if they change any thing drastically (say instaed of litening to Click if they use onMouseDown) I need to tweak the test script.
这篇关于在 QTP 中测试飞出菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!