CraigB
5 years agoContributor
Refresh files
Hi
I can't find the command to refresh files. How do I force TestComplete to refresh all files so that changes are reflected in the script files it's using to run tests if I change something w...
Does that mean there's a function that I can execute in a script that will cause TestComplete to reload all script files?
No.
When you click "run" in TestComplete to run a project, it basically does a Runtime compile of all the script files. So, while you can change files while the project is executing, it will not take effect until the next execution. This is why there are certain options that you can change during a run and certain ones you can't.
The suggestion for OnLogError is to allow you to execute special code when an error is written to the log. It doesn't allow you to CHANGE the scripts while running, just that you can set up to run code on an error that will do certain tasks at that error. You still can't change code and have that changed code execute. Sorry, man.
I'm not trying to change any scripts while the tests are running, at least not in the sense of having changes be executed by the tests. What I want is extremely simple. Currently, if I make a change to a script while no tests are running, when I go back to TestComplete it asks if I want to refresh the files. All I want is to be able to refresh the changed files once the test run is complete without either having to wait until the test run is complete to save changes or make unnecessary changes and resave the file so that TestComplete will refresh them. I'm not asking for JIT or Edit and Continue. All I'm trying to accomplish is the extremely simple task of having TestComplete refresh the files after a test run even if they were changed while the tests were running.
The problem is that the changes don't even take effect on the next run because unless I hack my way around it, TestComplete doesn't refresh the changed files if they were changed while it was running tests.
Generally... don't change files while the tests are running. I think TC flushes back to disk anything that was used for running.
If you need to alter files while the test is running, I would suggest you open a copy of TC on another machine, make your changes, check them into your source control, and then redownload to the execution machine.
TC doesn't overwrite files I change while it's running.
That proposed solution is even worse than what I'm currently having to do. It's bad enough that I have to make unnecessary changes to the files so that the timestamp is changed to get TC to refresh the changed files. Making unnecessary source repository commits on a second machine (for which I'd have to buy a second TC license) and then pulling those to the primary machine... The less said about how ridiculous that is, the better.