(转) QTP Scripting - 实践9

上一篇 / 下一篇  2008-12-20 12:10:34 / 个人分类:QTP

Write a program to Dynamically adding to WebList ?

思路:html dom 技术

脚本代码:

    Dim objDoc
    Dim objElement
    Dim newNode

    Set ōbjDoc = Browser("Browser").Page("Page").Object
    Set ōbjElement = objDoc.GetElementByID("WebList")

   

    Set newNode = objDoc.createElement("option")
    newNode.Text = "Test——pcl"
    objElement.add newNode

    Set newNode = Nothing
    Set ōbjElement = Nothing
    Set ōbjDoc = Nothing


TAG:

 

评分:0

我来说两句

Open Toolbar