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...
It appears your labouring under a couple of misapprehensions. One is that I have time to waste waiting for tests to complete before I make script changes. I can't understand why anyone would be willing to waste time like that. If there's a problem with a script, or even if the latest change works and so now I'm going to go on to adding the next steps, why would I wait rather than just making the changes? The second is that you seem to think I actually use TC as a place to edit anything other than things that are TC-specific. I value my time and sanity way too much to consider editing scripts in TC. TC is a place to run test scripts. It's certainly not a place to do any sort of code editing.
Either way... TestComplete cannot use new script code while the automation is running. It's not a dynamic project like a web page that updating script and hitting "refresh" will cause new code to be used right away. Again, the best analogy I have to explain is that clicking "Run" on TestComplete essentially "compiles" what is to be run at that moment and loads it into memory. Anything that is executed is done off that in-memory copy. So, even if you change the script at that time, TestComplete cannot use it until the NEXT execution. So it really doesn't matter what tool you use to edit the script, TestComplete must wait until the next execution to use the new code. This is the way it has been since I started using the tool in version 1.52. It's a fundamental architecture.
As to "refreshing" the code changes AFTER the execution is run... My suggestion still stands, whether or not it meets what you're expecting. New script changes need to be brought into the project through some other means. I'm guessing that when the automation completes, the old code is still present on screen and the new code is not there. If you close the project (and don't save changes) and then re-open, your new code SHOULD be present at that point and available for the next execution.
As for waiting for the execution to complete before trying out new code... that's why most users here separate their development environments from their execution environments. LinoTadros 's suggestion of using TestExecute to actually run the project is part of that. You have an environment (VM, etc) that has TestExecute on it and on which you have a client for your source control tool. You pull down the latest source and then execute it with TestExecute (no IDE or anything required, just command line). CI tools like Jenkins are great for this.
Then, in the meantime, on whatever environment you choose, using whatever code editor you choose, you can continue to develop your automation. For myself, when I'm developing, I NEVER execute a full project (ours takes upwards to 14 hours to run) in my development environment. I create harnesses, etc., to test new code before I put it out for general test execution. That saves me time for my debugging process and makes for much more stable code for general execution.
We are happy to continue to help you figure out a solution that will work for you. But please keep in mind the limitation that I mention at the top: That new code will not execute until the current test is done. There are any NUMBER of techniques, processes, procedures that you can use to work with code while a test is running, but you cannot get around that limitation.
"Either way... TestComplete cannot use new script code while the automation is running. It's not a dynamic project like a web page that updating script and hitting "refresh" will cause new code to be used right away."
And again, that's not what I'm trying to do at all.
CraigB wrote:
"Either way... TestComplete cannot use new script code while the automation is running. It's not a dynamic project like a web page that updating script and hitting "refresh" will cause new code to be used right away."
And again, that's not what I'm trying to do at all.
After execution is complete, does closing the project and reopening it (don't close and reopen the whole tool) refresh the code properly?
Yes, but that's more of a waste of time than having to make an unnecessary change and save the file again so that TestComplete asks if I want to refresh them. Less than making unnecessary commits to source control and pulls from source control (though that has the virtue of probably taking enough time to let the current test execution complete even though it does pollute source control until I take the time to squash all the commits).
TestComplete already monitors the files when tests are not running. What I find suprising is that it doesn't check when a test run completes, or even while a test run is in progress. Either of those would allow it to offer a refresh after test execution completes without additional steps by the user. It won't matter much when changes become rarer, but right now the changes are happening quickly as tests are created, updated and fixed. The frustration of not having general auto refresh or a way of forcing a refresh within TestComplete (since a command in TestComplete would presumably allow me to set up a shortcut or use an existing one) adds up quickly when there are lots of changes being made.
Again, as mentioned by LinoTadros , the way you are editing automation for TestComplete (using a different editor than the TC IDE) is not EXACTLY a standard methodology for most users... not saying it's not allowed or valid, just not standard. So there are probably "holes" in how TestComplete does things since it is built on the basic assumption that you're editing within the TC IDE.
If you think a feature set is missing, there is a forum here that allows you to make suggestions which can then be "voted up" by the community. Make a request there and see where it goes. As it stands, I don't think anything exists for your specific need at this time.
I've already put in the feature request, but I fully expect that to come to nothing. If a feature like that isn't there, considering other basic features that are missing, I have no doubt that there's no intention of ever putting it in. And I can't bring myself to use the TC editor because it's just not designed for editing code. Or anything, really.
Thanks for your time.