Forum Discussion

muralidharan18's avatar
muralidharan18
Occasional Contributor
8 years ago
Solved

Project Variables

Hi,

I am automating a project where I need to use more than 100 project variables.  While automating exactly after 55th project variable it throws jscript Runtime error.  Whats the maximum number of project variables test complete can hold. If there is any value how I can increase the number of project variables. Please any help me.

 

Thanks,

Muralidharan

  • tristaanogre's avatar
    tristaanogre
    8 years ago

    That line is probably correct in how it is implemented.  However, as mentioned above, how the data is retrieved is a different story. While you're bringing things in via Excel, IIRC, it's still using the Microsoft Jet engine behind the seens and there are a maximum number of connections that can be opened.

    Can you give us the full code for the whole loop or even the code unit where the Excel sheet is accessed initially? It sounds like you are re-opening the data connection multiple times which could result in the problems you're having.

    You also mention "in each script". so, it sounds like you're calling that assign code in multiple places in multiple tests. I'm guessing that, in each script, you're opening a connection to the excel sheet and then making the assignment. Somehow, you need to make sure you close your data connection when you're done with it. So, again, having the code where you're making the initial connection to the Excel sheet is going to be helpful.

6 Replies

  • baxatob's avatar
    baxatob
    Community Hero

    Hi,

     

    Can you provide a details of your error? You can find it in the test log.

    • muralidharan18's avatar
      muralidharan18
      Occasional Contributor

      Im using the project variables like this in each script.  

      Keys(Project.Variables.Sheet1.Value("Name"));

       

      While executing the whole project suite I'm getting Jscript Error(Unspecified Error).  The Error is directly pointing to the line where I'm fetching data from excel sheet.  While executing separately each file runs perfectly without any error. While executing in whole project suite repeatedly its throwing the error after 56 Project variable (all 56 are in different scripts).

       

      After 56 different project variables I repeated the same files which were executed first, these files run without any error.  Only the files which are fetching new values are throwing error.

       

      Can any one help me?

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        That line is probably correct in how it is implemented.  However, as mentioned above, how the data is retrieved is a different story. While you're bringing things in via Excel, IIRC, it's still using the Microsoft Jet engine behind the seens and there are a maximum number of connections that can be opened.

        Can you give us the full code for the whole loop or even the code unit where the Excel sheet is accessed initially? It sounds like you are re-opening the data connection multiple times which could result in the problems you're having.

        You also mention "in each script". so, it sounds like you're calling that assign code in multiple places in multiple tests. I'm guessing that, in each script, you're opening a connection to the excel sheet and then making the assignment. Somehow, you need to make sure you close your data connection when you're done with it. So, again, having the code where you're making the initial connection to the Excel sheet is going to be helpful.

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    I'm with baxatob... it would be helpful to know a few more details about what you're experiencing. As Marsha_R, mentioned, I'm not sure there is a maximum number of project variables.  However, it depends a bit as to how you're populating the variables, what code you're using, etc., as to whether you've hit some other memory limit. For example, there is a maximum number of open connections to a Microsoft JET data source so, if you're using some sort of DDT object to read values in from a file and re-opening the connection each time through the loop, you're potentially blowing something up there.

    So... two things:

    1) What code are you executing? If you can't give the specific code, give us some pseudo-code or something to show what you're doing and

    2) What error are you getting?