Forum Discussion

mkruszynski's avatar
mkruszynski
Occasional Contributor
9 years ago

Python Script not running following upgrade to TestComplete 11.3

I have some python scripts that make a database call and populate a a variable with data.  I then try to put some of the data into a local variable for a keyword test.  This was working fine in Test Complete 11.2 but since upgrading to Test Complete 11.3 the script is not longer working.  See the code snippet below:

 

con = ADO.CreateADOCommand()
con.ConnectionString = GeneralFunctions.DatabaseConnectionString()
con.CommandText = "SELECT TOP 1 a.GenericName,  FROM Table1 a, Table2 b, Table3 c WHERE ORDER BY NEWID()"
con.CommandType = cmdText

rs = con.Execute()
rs.MoveFirst()

 

Below is the error message that I get:

 

 

Python runtime error.

 

TypeError

'IDispatchIndexedPropertyrapper' object is not callable.

 

 

  • Someone else found that using brackets instead of parens worked for them.  Eg.

     

    records.Fields.Item['FieldName'].Value

     

    Your description doesn't show that usage (but I suspect there are some bits missing in the description).

    Does that work?

  • Someone else found that using brackets instead of parens worked for them.  Eg.

     

    records.Fields.Item['FieldName'].Value

     

    Your description doesn't show that usage (but I suspect there are some bits missing in the description).

    Does that work?

    • OlgaV's avatar
      OlgaV
      Occasional Contributor

      Had the same issue and your sollution joseph_michaud worked for some of the scripts. Thank you!

       

      In another python script that was working perfectly fine before the upgrade I am getting the RuntimeError:
      The parameter is incorrect

      Here is the line of code that throws the error:

      ProjectSuite.Variables.TestResults = ProjectSuite.Variables.TestResults + Project.TestItems.TestItem[ProjectSuite.Variables.TestCount].Name + ": "

       

      The variables do exist in the project suite. Looks like the problem is with TestItem[ProjectSuite.Variables.TestCount] part.

      Any suggestions are very much appreciated.

      • joseph_michaud's avatar
        joseph_michaud
        Moderator

        OlgaV:  I don't see it.  Tried creating a simple test using your example and it works fine for me.  Perhaps I'm missing something...

    • mkruszynski's avatar
      mkruszynski
      Occasional Contributor

      Joseph,

       

      Thank you for that solution.  Changing from () to [] worked for me but I am running into other issues with my python scripts around arrays and such.  Do you know why scripts that were running in TestComplete 11.2 worked fine but since the upgrade these scripts are no longer working when there have been no script changes.  It is a bit concerning that an upgrade could break my scripts so easily and I haven't seen any change log as to changes to Python scripts with TestComplete.

       

      Thanks,
      Mark

      • joseph_michaud's avatar
        joseph_michaud
        Moderator

        Good question.  I don't have an answer.  If you have more problems croppingup then this is an issue best dealt with in a support case.  We'll need to get some samples in for the developers to look at.

         

        Please open a support case.