Forum Discussion

saaran's avatar
saaran
Contributor
10 years ago

How to import excel sheet from desktop to test complete tool?

Hi All,

 

I need reply from your end view's, please see the below questions.

 

1. Is there any option to import and export excel file from desktop to test complete tool?

2. Is there any option to proceed execution, even though we get run time error?

 

 

Regards,

Sarankumar P.

  • Ravik's avatar
    Ravik
    Super Contributor
    Hi, We can Import excel data from Desktop to TestComplete. In a TestComplete a feature is available "STORE" in store we can save our data (it would be saved in encrypted format) Refer Snap 1 2- by using EVENT in TestComplete you can skip error (on Event you can define the next step what you want to execute). You can also use "ON ERROR RESUME NEXT" for skip the error pop up and go for the next step. Note: If you are using "ON ERROR RESUME NEXT" you have to check error code other wise it will be skip your application pop-up too. This may help you solve your problem.
    • saaran's avatar
      saaran
      Contributor

      Thanks buddy,

       

      1. "On error resume next" is used to avoid the run time error, but for me eventhough if run time error throws. i have to click it and proceed for execution.

       

      2. can you show the screen shot to import excel sheet from  desktop to test complete tool.

       

      Once again thanks for your efforts.

       

      Regards,

      Sarankumar P

       

    • saaran's avatar
      saaran
      Contributor

      Hi,

       

      I tried by using STORE, but can't able to map the excel sheet inorder to import...

       

      Can you please give some more suggestions or different ways to import excel sheet.

       

       

      Regards,

      Sarankumar P.

      • finae's avatar
        finae
        Contributor

        Another option for using/reading files : 

         

        use DDT.ExcelDriver

        an example:

         

        set xlDriver = DDT.ExcelDriver("C:\mytest\test.xls","Sheet1",true)
        xlDriver.First
        while not xlDriver.EOF
           col1Value=xlDriver.Value("TheColumnName")
           col1Name=xlDriver.ColumnName(ColumnIndex)   ' i m sure this is 0 base
           ..///codes
        
           xlDriver.Next
        
        wend

        This will read the xls file and loop through all records (make sure they are string base), until the last record

         

        as far as the error mentioned, if the error is an application error and does not crash but allows you to continue (ie handled application thrown error), you can also consider using OnUnexpectedWindow.