Forum Discussion

benholt's avatar
benholt
New Contributor
6 years ago

Re: RE: Calling python script from Test Complete

Hi   I'm trying to run a python script from TestComplete, and am having a problem. I tried following the instructions within a previous discussion https://community.smartbear.com/t5/TestComplete-...
  • benholt's avatar
    benholt
    6 years ago

    My problem ended up being that I was using parentheses, but I should have been using brackets for the Sys.OleObject.

     

    DOES NOT WORK

    Sys.OleObject("WScript.Shell").Run("C:\\Python37\\python.exe '<Path to script>.py' -p '<Path to input file>'")

     

    WORKS

    Sys.OleObject["WScript.Shell"].Run("C:\\Python37\\python.exe '<Path to script>.py' -p '<Path to input file>'")

     

    Thanks

    Ben