Forum Discussion

alexis733's avatar
alexis733
Occasional Contributor
7 years ago

object doesn't support this property or method

Hello,

 

This is weird for me, I'm working with vbscript in testcomplete and until a few hours ago my code was working (see below a snippet) but suddenly it prompted me an erro telling me that the object doesn't support this property or method: 'DataPool.item'.

 

The code is here:

 

Function DataPoolfile()
  DataPool.FilePath = Project.Path + "TestData\\" 'Test data sheet path
  DataPool.FileName = Project.Variables.Filename 'Test data file name
  DataPool.SheetName = Project.Variables.Sheetname 'Test data sheet name  
  DataPool.New()
  firstCommand = true
  prevCmd = ""
  Set objArrayList = CreateObject("System.Collections.ArrayList")

  While (not DataPool.EOF)
     If (DataPool.Item("Run") = "Yes") Then
         run = DataPool.Item("Run")
         sc = CDbl(DataPool.Item("Scenario #"))

     ....

     End If

     ...

  Wend

 

 

Please, I need help!!!

4 Replies

  • NisHera's avatar
    NisHera
    Valued Contributor

    Not a VBS expert...

    But if you share where DataPool object is being defined how did you access it may give us more insight.

    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      NisHera wrote:

      Not a VBS expert...

      But if you share where DataPool object is being defined how did you access it may give us more insight.


      I'm with NisHera here... we really don't have any exposure as to what "DataPool" is.  You're calling a "new" method on it which I can only guess is doing some kind of initialization of something.  If you can give us exposure as to what that is doing, we might be able to answer you better.

       

      Suggestion: It looks like you're using an excel sheet as the data source for some sort of data driven loop.  Is there a reason why you're not using the DDT.ExcelDriver method to create that data source?  Or is that what "DataPool" is doing?