如何在QTP中参数化链接对象/元素?

时间:2013-03-17 07:38:56

标签: automated-tests qtp

请给我一个如何在QTP中参数化链接元素的提示......由于我们可以参数化'WebEdit'元素/对象,我们可以参数化'Link'元素/对象吗?我们怎么做?

1 个答案:

答案 0 :(得分:0)

通过参数化,您的意思是参数化Link元素的属性以使用描述性编程来识别它吗?或者是别的什么??请详细说明!!
您可以为要使用的每个对象类型构建类似下面的函数。

public Function CreateLinkDescription(LinkInnerTextValue, LinkHrefValue)
    Set objLink = Description.Create()  
    objLink("innertext").Value = LinkInnerTextValue
    objLink("href").Value = LinkHrefValue      
    'Add any other properties that you want to specify in the same fashion as above                                                                                                    
    Set CreateLinkDescription = objLink
End Function