51Testing软件测试论坛

标题: QTP--下拉菜单问题 [打印本页]

作者: caibei    时间: 2008-4-23 17:17
标题: QTP--下拉菜单问题
我录制了一个流程,其中包含了通过下拉菜单选值的过程;但是当回放时,发现QTP并没有把这个下拉菜单中的值记录下来(PS:我返回那个页面去查询生成的记录时发现,下拉菜单中的值为空)。请问有知道这是由于什么问题造成的吗?
以下是录制脚本中关于下拉菜单这一部分:
Browser("Merchandise Assortment").Page("xxxx").WebList("seasonid").Click
Browser("Merchandise Assortment").Page("xxxx").WebList("seasonid").Select "Spring"
Browser("Merchandise Assortment").Page("xxxx").WebList("seasonid").Click
Browser("Merchandise Assortment").Page("xxxx").WebList("year").Click
Browser("Merchandise Assortment").Page("xxxx").WebList("year").Select "2008"
Browser("Merchandise Assortment").Page("xxxx").WebList("year").Click
Browser("Merchandise Assortment").Page("xxxx").WebList("category").Click
Browser("Merchandise Assortment").Page("xxxx").WebList("category").Select "BOTTOM"
Browser("Merchandise Assortment").Page("xxxx").WebList("category").Click
作者: walker1020    时间: 2008-4-25 00:41
你调试一下,看看是 QTP没有选中下拉框的值 还是没有点击?我们手工操作的时候,一般在选择了某个选项后,顺便点击一下。因此在选择了某个选项后可能需要下面的语句:
Browser("Merchandise Assortment").Page("xxxx").WebList("seasonid").Submit
作者: caibei    时间: 2008-4-28 12:04
Hi walker,我知道是什么问题了,在QTP第一次录制的过程中会生成一个多余的动作:
Browser("Merchandise Assortment").Page("xxxx").WebList("seasonid").Click
Browser("Merchandise Assortment").Page("xxxx").WebList("seasonid").Select "Spring"
Browser("Merchandise Assortment").Page("xxxx").WebList("seasonid").Click(这一步骤是QTP录制时自己生成的,我录制脚本的时候并没有再次点击这一下拉菜单)
当在expert view 中删除这一步骤,再次回放的时候下来菜单不能录值的问题就不会出现了。你说的那个操作,似乎是控制这一页面上“确定”这一操作的,Browser("Merchandise Assortment").Page("xxxx").WebList("seasonid").Submit时会直接关掉该页面。不过还是要谢谢你!




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2