Forum Discussion
For the paramstr option, it's my understanding that builtin.paramcount is 0 unless it's being executed via command line. So if you execute tests manually and via command line, that code would only work when run via command line. That's how I'm determining whether the run is an automated run vs. a manually executed run.
getcurrentprocessid is a a better way than my proposal to check for the process, I wasn't aware of this method.
Thanks!
jmcpeek wrote:
For the paramstr option, it's my understanding that builtin.paramcount is 0 unless it's being executed via command line. So if you execute tests manually and via command line, that code would only work when run via command line. That's how I'm determining whether the run is an automated run vs. a manually executed run.
The command line of a process contains the executable path and arguments, for example:
C:\TestComplete\Bin\TestComplete.exe C:\TestComplete\Bin\TestComplete.exe C:\MyProject.pjs /r /e
BuiltIn.ParamCount ignores the TestComplete/TestExecute exe path and counts everything else -- project path, custom arguments, and so on. So when you launch TestComplete manually, ParamCount is 0.
But in BuiltIn.ParamStr(0), 0 refers to the TestComplete/TestExecute exe path. This value always exists. Other arguments start with index 1. In the 2nd example above, ParamStr(1) is "C:\MyProject.pjs", ParamStr(2) is "/r", and so on.
Related Content
- 12 years ago
- 3 years ago
- 12 years ago
Recent Discussions
- 10 hours ago
- 7 days ago
- 10 days ago