Exforsys
+ Reply to Thread
Results 1 to 8 of 8

CreateObject ,DLL, EXE, Run Time data

This is a discussion on CreateObject ,DLL, EXE, Run Time data within the Software Testing forums, part of the Testing category; I have three questions 1)Can You please explain me what is createobject function .....how to and where to use it. ...

  1. #1
    nehasahu is offline Junior Member Array
    Join Date
    May 2007
    Answers
    15

    CreateObject ,DLL, EXE, Run Time data

    I have three questions

    1)Can You please explain me what is createobject function .....how to and where to use it.

    2) What are DLL and EXE files do we use them in QTP.

    3) THe data which we trap in the datatable at runtime is lost from the datatable after the program executes.... how to store this data permanently.


    Thanks in advance


  2. #2
    ramajkrishna is offline Junior Member Array
    Join Date
    Mar 2007
    Answers
    7
    1. CreateObject function is to create and return a reference to an automation object.
    for example if you want to work with excel then you can create a reference to excel object then later you can apply methods on the reference.
    'creating a reference to excel object
    set myxls=CreateObject("Excel.Application")
    'making excel application visible
    myxls.visible=true
    'adding workbooks to excel application.
    myxls.workbooks.add

    3. if you want to store the data that is created in runtime, just keep a statement in your script that exports the data to some external file. like,

    datatable.export "C:\myruntimedata.xls"


  3. #3
    nehasahu is offline Junior Member Array
    Join Date
    May 2007
    Answers
    15
    Hi Rama,

    Thanks a lot for the answers.
    But i still have a doubt on my third question that i dont want to export all the data from the datatable to excel sheet..... i just want to export my third column data to the excel sheet ....So in this case what should be done.

    Thanks


  4. #4
    ramajkrishna is offline Junior Member Array
    Join Date
    Mar 2007
    Answers
    7

    Exporting only one column

    hi neha,
    if you dont need other columns in the datatable to be exported to external file, then you can do one thing.
    Delete all other columns of the datatable except the one column you want to export.
    and then the export the datatable by using export method.

    Datatable.GetSheet(" ").DeleteParameter(" ")
    Datatable.Export "C:\myruntimedata.xls"

    but here the problem is you will lose other columns' data of the runtime datatable.

    Thanks&Regards


  5. #5
    nehasahu is offline Junior Member Array
    Join Date
    May 2007
    Answers
    15
    ya rama u are correct i can do that but i also dont want to loose my other data which is there in the datatable.


  6. #6
    ramajkrishna is offline Junior Member Array
    Join Date
    Mar 2007
    Answers
    7

    try this way

    Export the entire datatable to one external file and after this delete the parameters you dont want. After this export your column to another external file.
    hope this works and clears your problem.

    Thanks & Regards
    Ramakrishna.Jangatisetty


  7. #7
    nehasahu is offline Junior Member Array
    Join Date
    May 2007
    Answers
    15
    That sounds Great!!!!!!
    Thanka a lot Rama


  8. #8
    ramajkrishna is offline Junior Member Array
    Join Date
    Mar 2007
    Answers
    7
    Thats Great.
    hope your problem is cleared


    •    Sponsored Ads



Latest Article

Network Security Risk Assessment and Measurement

Read More...