Forum Discussion

TESTUS's avatar
TESTUS
Contributor
14 years ago

Running a TestedApp with Parameters

I have wrtitten a tool that is called with parameters. Is there a possability to run it without coding my username password?



The only way to run a TestedApp with parameters I can find is the "RunAs" method which requires to write my password in the sourcecode. The Run method somehow is not able to provide parameters to a TestedApp.



My current code snippet looks like this:



TestedApps.ExecuteSkript.RunAs (<domain>, <username>, <password>, "", <the_parameter>, -1, False, 90000)

4 Replies

  • irina_lukina's avatar
    irina_lukina
    Super Contributor

    Hi Oliver,


    As far as I understand, the problem is that the code contains your password as a plain text. If it is so, I recommend that you store your password (or any other secret information) to an encrypted data storage and then connect to this storage from script and use the retrieved information in your code.


    For this purpose, try using the script provided in the following How To entry:

    Working with encrypted data storage

  • This is actually only one of the issues I got. I forgot to mention that the test which containts these lines is supposed to be run by multiple workstations and multiple users.

    So the most simple solution would be a function that is able to call a TestedApp, provide the parameters but does not need to know any username, password, etc. Instead it should use the current user, just like the "TestedApp.Run" method.
  • irina_lukina's avatar
    irina_lukina
    Super Contributor

    Hi Oliver,


    You can try running your application in the Simple mode and specify all the needed parameters in the Parameters dialog. In this case, the application will be launched using the specified command-line arguments and working folder specified in the Parameters dialog. The application will be launched under the same user account, under which TestComplete is running.


    Does this help?