Micro Focus QTP (UFT) Forums

Full Version: Testobject at Runtime
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Can anyone give me an advice on how to create a Testobject at runtime?

I'd like to create a "Link" Testobject wich is not situated in the object repository. I want to generate it at runtime using the description stored in the excel sheet.

Tanks and cheers,
Giama
Hi,
I think you can try this.

Initialize the excel object DOM and pass the link name as the parameter to the action.

Code:
Set excel = createobject("excel.application")
    excel.visible=false
    Set obook=excel.workbooks.open("C:\test.xls")
    Set osheet = obook.worksheets(1)
             LinkName=osheet.cells (2,13).value
              
Set oDesc = Description.Create()
oDesc("name").Value = "{Link Name}"
Browser("Browser").Page("Page").Link(oDesc).Click