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...
Simple answer you can't, TC doesn't even let you change your files while a test is running. What is the use case for this? If you're changing your scripts as a test is running that kind of defeates the purpose of automation.
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.