Forum Discussion

canadanj's avatar
canadanj
New Contributor
9 years ago

Can i get TestComplete12 to run Python with Python2.7 instead of Python3?

I am attempting to test an ESRI ArcMap Extension. There is a proprietary Python library that comes with any installation of ArcMap called arcpy. 

 

I am testing against versions of ArcMap that have come with an arcpy compatible with Python2.7

 

It seems that importing arcpy in TestComplete12(after placing the library in the correct place) does not work because TC12 Python scripts run in Python3.

 

Is there any way to force TestComplete12 to use Python2.7?

2 Replies

  • As said, unlikely that what you are asking is possible DIRECTLY.

     

    Work around I would investigate...

    You can kick off whatever you need to through the windows shell from TC. You should be able to set up a Python 2 environment on your machine, wrap whatever you need to do with 'arcpy' in its own Python script and call that from TC (via WshShell).

     

    I would also see if  your ArcMap Extension is accessible via .NET. It is not hard to call .NET DLLs from TC and you could do the same thing (and possibly faster than accessing it via Python) if your ArcMap extension has that interface.

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    I don't believe there is.  TestComplete's use of the different scripting engines is built into the code base, as far as I know, and is not open to configuration by the end user.  I can't tell TC, for example, to use JavaScript in an engine other than V8.