Ask a Question

Refresh files

CraigB
Contributor

Re: Refresh files

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.

LinoTadros
Community Hero

Re: Refresh files

Sorry Craig that you feel that @tristaanogre 's help is ridiculous, he is just trying to help you.

The fact that you bought a TestComplete license to end up using other editors to work on your TestComplete files, is the ridiculous part.  You only need a TestExecute license for that which is 1/10 of the price.

What @tristaanogre and I (and other community members) are trying to do on this form is help everyone voluntarily with our knowledge and experience with the product.

You can always fill a support ticket and get answers directly from the TestComplete Support Team if you prefer.

The way you are using TestComplete is unorthodox and not the best way to use TestComplete.

 

I believe @tristaanogre  was trying to help you realize that and save you time.

 

Cheers

Lino

 

CraigB
Contributor

Re: Refresh files

The company I work for has a TestComplete license, so that's what I work with.  Also, I imagine that creating tests to run with TestExecute would be excruciatingly difficult since one would have to know how to create all the files required for the tests to run, not just the scripts.  The license also isn't the only part that is ridiculous.  I'm pointing out that every time I need to refresh files I have to do some unnecessary steps.  His suggestion was that I get around doing those extra steps by doing many more and far more time consuming steps.  In other words, that post wasn't an attempt to help since it was presenting an approach that is clearly far far worse.  He has responded to other questions with actual help, so I assume that the post about using git wasn't intended to be helpful.

If the best way to use TestComplete is to waste lots of time waiting around for tests to complete (and not, that's not because one has to run a full test suite or anything like that, but even having to wait over and over for parts of test suites that are being set up/modified/fixed adds up pretty quickly), then what you're really saying is that the best way to use TestComplete is to use some other tool instead.

 

I can't see how there's anything unorthodox about using a working editor designed to for editing code rather than the TestComplete editor.  TestComplete already monitors files for changes (so long as tests aren't running).  That means that using external editors has at least been partly considered, so it's not possible that it's unorthodox.

LinoTadros
Community Hero

Re: Refresh files

I can only share my experience in this situation and hope it works for you.

 

I have a Testsuite that takes 6 hours to run, I don't wait 6 hours for the test to finish for me to make changes.  I continue to work on my scripts.

The way that is done is by executing the 6 hour tests on a different machine running TestExecute or a VM on your same machine or even running the test in CrossBrowserTesting in the cloud.

The formula is to use CI, Use TestComplete to create your initial projects and files easily, then check them into source control (GIT, Subversion, TFS, whatever...) Then once files are checked in, that triggers a deployment build to the VM or the other machine running TestExecute.

I use this method and I can NO conflict between the running project and the checked in files deplyed to the VM

 

Hope that helps

-Lino

tristaanogre
Community Hero

Re: Refresh files

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.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
CraigB
Contributor

Re: Refresh files

Thanks Lino.  I can see that working for your situation.  Unfortunately I'm in the process of creating and updating tests, including moving from v12.6 to v14.  If I run a test and it fails, I look at what might be wrong.  If I can see what's wrong I go and fix it.  Or, if a change I made fixes a problem, I go and fix anywhere else I know that problem exists.  In the meantime I let the tests carry on running - there's cleanup to do so that the tests can be run again, such as closing the app under test, possibly removing a database, whatever.  So now I've made changes and I want to test again.  But because I made changes while the tests were running I have to change at least one file again and save it again so that Test Complete recognises that a file has changed.  Since I'm making a lot of changes as the tests are added or updated, this ends up adding up to a lot of extra time and frustration.

 

So right now my process is 
Make a change

Run the test applicable to the change

If the test runs successfully, move on to the next change while any cleanup is run.  Otherwise look for what's wrong and, if found, fix the problem.

If all changes are finished before the cleanup is finished and the test run completes, change a file again and save it so that the files are refreshed in TC.

Run the test again (or run the next test if the previous test was successful).

 

Only once I have the tests running (or if I'm done for the day) will I commit them.

 

Once the tests are all done, I'll switch to running them all, but at this point they're being developed, so I'm just running the parts of the project that are applicable.

 

I'm used to development IDEs and general code editors which refresh files automatically when they're changed by other software whether they're in the middle of a debug session or not.  So if I change a config file or pull code from a repository or otherwise change a source file, the IDE immediately refreshes the file.  The code changes don't generally become part of the executing code unless a new debug session is started (or if edit and continue is enabled and the code stops at a break point).  But they're always there without any intervention from me apart from possibly having to do what TestComplete requires when tests aren't running - accepting the file changes.

CraigB
Contributor

Re: Refresh files

"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.

tristaanogre
Community Hero

Re: Refresh files


@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?


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
CraigB
Contributor

Re: Refresh files

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.

tristaanogre
Community Hero

Re: Refresh files

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.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
cancel
Showing results for 
Search instead for 
Did you mean: