Forum Discussion

dkinne's avatar
dkinne
Occasional Contributor
11 years ago

Disable .bak creation through Testcomplete 9 when editing script files

Hi,



i want to disable the function, that TestComplete 9.31 creates a .bak file withhin the Scrupt folder of an project, when some codes changes the .svb



The reason is, that first:



1. Checking from .bak files to svn generates exception and must be extra excluded

2. I've cloned a project within TC with the result of an error during save when modifying code of an script file in the cloned project that .bak file cannot be created.



Regards,



Dirk

6 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    I don't think that this is something that can be done.  It's part of the functionality of TestComplete that, if you want to Undo a change, it uses the .bak file to know what changes can be undone.  I do have some suggestions for your two scenaros.



    1) bak files are supposed to be excluded from source control.  They are not necessary in order to check in or check out code.  They are used (as mentioned) only as backups in order to restore code using Undo



    2) I attempted to reproduce this in TestComplete 10.10 and could not.  I don't have your version of TestComplete to try it in so I can't necessarily say the problem is in TestComplete itself.  However, if you're checking the BAK file in and out of your source control, it's possible that the bak file, when cloned, was cloned in a "read-only" state and so cannot be over-written.  Again, BAK files should not be part of any source control so, if you remove them from your source control processes, this might go away as well.
  • dkinne's avatar
    dkinne
    Occasional Contributor
    I know about excluding the .bak from the source control.



    In my case I think it's a little bit more complicated to explain.



    to my second point of disabling to create the .bak from the cloned project:



    1. I run several vm-ware player 9 machines at my host. In every VM is TestComplete 9.31 installed

    2. Amongst other things we develop plug-ins for XML-Editors like XMetal, Arbortext and so on. That's why i've used an USB-Stick locally and create a Share on it. From every VM I connect to the Share at my host open open the TC Project over the Share.

    3. Only me is working over the Windows Share and we have only 1 Floating TC Lic, so that the Test-Project can only opend once

    4. The Test-Project is organized as an Project Suite with several Projects which includes many Keyword-Tests with Units and so on

    5. The Issue occurs only then, when trying to save an change within the Scripts Folder of  one special project (which was cloned before) and only if I working over the windows share.

    6. All other Projects within the Projects Suite had no Problems, when changing Code there inside the scripts area.



    The easiest why to fix would be to exclude the .bak creating withtin TestComplete. But when this is not configurable via any option then the goal would be to copy the files over the network locally to the virtual machine directly or use our svn and check-out check-in every time when using a different VM the files from the trunc. This is annoying, because of struggling with so many VM's. The Setup with the windows share was technical ugly, but quick and nice for my setup.



    Regards,



    Dirk
  • dkinne's avatar
    dkinne
    Occasional Contributor
    I've tried to reproduce the screnarion with an empty Project and making a clone from them over the share, but can't reproduce the saving .bak issue.



    Maybe our Project is damaged over time. Project was created with TC 8.7, migradted then to 9.1 and 9.2. Currently working on it with 9.31
  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    That's possible.  Could also, still, be a "read-only" or "locked" type problem in your share as well.  If the .bak file was not completely released by PC1 before you tried and operate on it on PC2, that could generate a similar issue.  
  • dkinne's avatar
    dkinne
    Occasional Contributor
    But why then I can change other Script files in the Project Suite from other Projects without problems. The issues occurs only in that one which was cloned.



    I've also checked, if one is read-only, but isn't.
  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    That I cannot say...  my statements are just conjecture and guess since I haven't been able to reproduce it.  



    TestComplete Help does say the following concerning the error message.



    When you are modifying project items and their child elements, TestComplete can make a backup copy of project item files. For instance, when you modify script code and save the changes, TestComplete saves the older version of the script file to the file having the same name and the .bak extension. If TestComplete was unable to back up a file, it displays this error message to inform you about the error. Most possible causes for the error is that the .bak file already exists and it is locked by another application, or TestComplete does not have write permissions to save the file.




    So, it still does come down to a problem in writing the file.  Something you can try doing is manually deleting the file before you open TestComplete and see if the problem occurs again... it may simply be a corrupt BAK.