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...
The use case is that when an error comes up during a test I don't necessarily wait until the test run completes to start fixing the script that led to the problem. But if I save the changes before the test run completes I then have to make an additional, unnecessary change to get TestComplete to refresh the changed files.
You need to look at implementing events in TestComplete.
Especially, OnLogError event
Cheers
Lino
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.