fbpx

Can we use Excel file in zap-fix?

Can we use Excel file in zap-fix?

Home Forums ZAPTEST Old Posts Can we use Excel file in zap-fix?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #30575
    Barbara Jackson
    Participant

      Hello Zap,

      In QTP and UFT there is an option to importexport Excel file during runtime of a testing script, is there such option in Zap-fix Standalone version?
      And if yes then how do we do it?

      Thanks.

      #30576
      Sasha ZAP
      Moderator

        Hello BarbJack,

        Thank-you for your question.

        Basically in our latest Zap-fix Standalone versions there is already the following Excel file’s feature:
        Datatable.ImportCSV(<path>) – Imports Datatable to CSV during runtime.
        To read from a runtime Excel datatable:
        x = Datatable.Value("Name of the Spreadsheet")
        To write into a runtime Excel datatable:
        Datatable.Value("Name of the Spreadsheet") = x

        Our R&D Department works to implement the Export method as well.

        Until the new method will be published in teh next build you can use the following VBScript code to importexportreadwrite into and Excel file:

        Set objExcel = CreateObject("Excel.Application")
        objExcel.Visible = True
        Set objWorkbook = objExcel.Workbooks.Open("C:Test.xls")
        Set objWorksheet = objWorkbook.Worksheets(1)
        ‘Write into Excel Worksheet
        objWorksheet.Cells(1, 1).Value = "Number"
        objWorkbook.Save()
        ‘Read from Excel Worksheet
        value = objWorksheet.Cells(1,1).Value

        objExcel.Quit
        Set objWorksheet = Nothing
        Set objWorkbook = Nothing
        Set objExcel = Nothing

        Please contact Zap for further help.

        Thanks,
        Sasha

      Viewing 2 posts - 1 through 2 (of 2 total)
      • You must be logged in to reply to this topic.

      Virtual Expert

      ZAPTEST

      ZAPTEST Logo