Forum Discussion
8 Replies
- rraghvani
Champion Level 3
If there's no methods, you could use the shell command
Sys.OleObject("WScript.Shell").Exec("cmd /c [set environment variable]")
You could also write to a temporary file, and get your application to read that too. For example, https://support.smartbear.com/testcomplete/docs/reference/program-objects/storages/ini.html
- rraghvani
Champion Level 3
Is this a similar question to your other post https://community.smartbear.com/t5/TestComplete-Questions/Running-TCUnit-Tests/td-p/251675 ?
You can execute TC Unit Tests, but you can't pass a parameter to an individual method.
A possible solution is to create an environment variable, use TestComplete to set a value and then get your application to read this value.
- rraghvani
Champion Level 3
In TC, how are you settings the environment variable? And in VS, how are you reading the environment variable?
- sinisContributor
In TC, I have added a variable in project and then I am accessing the variable using script. Then setting it in environment variable.
In visual studio , I am getting the variable like
- rraghvani
Champion Level 3
Just looked into this and it seems like user and system environment variables can not be used in this manner.
So the other alternative is to use ini file as suggested before.
- sgouletContributor
I have used CLRBridge https://support.smartbear.com/testcomplete/docs/working-with/managing-projects/properties/clr-bridge.html to set a property of an object. Does that help?