Forum Discussion

esramirez's avatar
esramirez
Contributor
14 years ago

TestExecute API: Access to project variables

Is it possible to access project variables from Testexecute API? 
  • Hi,



    You need to pass the name of the object you want to obtain to GetObjectByName. Since, you need to get the Project object, pass "Project" as its parameter. It will return the Project object, and you'll be able to use its Variables property to access variables.
  • Thanks Jared!



    I managed to get project object.

    Per the online help, GetObjectByName() only works when a test is running. This may not work for me after all because what I want is to be able to update the project variables then start the execution. 



    Is there any other way to do this using TestComplete COM ?
  • Hi,



    Unfortunately, there's no other way to do this without modifying project files directly (strongly not recommended). You need to run a test to access run-time objects.
  • That is very unfortunate.



    I think the work around would be to rather than using the api to launch the tests is to use TestExecute command line. This way i can pass global variables to the tests.





    Are there any plans the api functionality will be expanded in the near future?



    Thank you for your time on this matter.



     
  • Hi,



    Unfortunately, I cannot tell you anything specific on this at the moment. Currently, there're no plans to change the present functionality.