Forum Discussion

David91's avatar
David91
Frequent Contributor
24 days ago
Solved

Script file not linked in Script.tcScript after adding new script – requires manual save

Hello,

 

I’m having an issue where newly added script files are not automatically reflected in the Script.tcScript file in my TestComplete project.

 

When I add a new script (e.g. MyTest.js) to the Script folder using the TestComplete interface, it is not immediately written to the Script.tcScript file. As a result, Git doesn’t detect any change, and the project structure is incomplete for others pulling the repo.

 

I noticed the change is only saved under these conditions:

  • When I manually click on the “Scripts” node in the Project Explorer and then press Save (or F5),
  • Or when I close the project, which prompts to save changes.

 

If I forget to do this, the Script.tcScript file remains unchanged, even though the script appears in TestComplete.

 

Could you please confirm:

  • Is this expected behavior?
  • Is there a way to force TestComplete to save the updated Script.tcScript automatically when a new script is added?
  • How can we ensure consistency in source control without having to remember to manually save the project file?

 

Thanks in advance for your help!

 

Best regards,

David

  • Unfortunately, that is the expected behaviour of TestComplete! Always remember to press "Save All Changes" button, as "Save the Selected Element" just saves that particular file. This will ensure that the Project Suite has been saved with the appropriate changes.

8 Replies

  • David91's avatar
    David91
    Frequent Contributor

    Thank you for your response. I’d like to provide some additional context based on my workflow.

     

    Previously, I used TestComplete’s built-in Git integration (through source control integration), and when I added a new script to the project, the Script.tcScript file was updated automatically. I did not need to manually press “Save All Changes” — the change was immediately visible in Git, and everything worked as expected.

    Now that I’ve switched to using an external Git client (Fork), the behavior is different. When I add a new script file, I can see the file is created and marked with a “+” icon in TestComplete, meaning it’s new and tracked. However, unless I manually save the entire project, the Script.tcScript file does not get updated, so Git doesn’t detect any change in the project structure.

    As a result, even though the new script exists and is versioned in Git, the Script.tcScript does not include it, and collaborators won’t see the script in the project unless I remember to save all changes manually.

    David

    • rraghvani's avatar
      rraghvani
      Icon for Champion Level 3 rankChampion Level 3

      I use Team Foundation Version Control Plugin, with Microsoft Visual Studio Team Explorer 2019. I no longer use the menu items that appear in Source Control in TestComplete, mainly because  the TFS plugin is clunky and outdated. 

      I perform all my check-in/out etc via MS Visual Studio Team Explorer, as the user interface and functionality is a lot better. The TFS plugin in TestComplete, is only used for visual representation i.e. to see what's added/removed/updated etc. in Project Workspace -> Project Explorer.

      I've ensured all testers follow this process, and we haven't have any issues since. Providing they "Save All Changes"!

      I'm not sure how up-to-date the Git Plugin is, but find something that best works for you and others.

  • scot1967's avatar
    scot1967
    Icon for Champion Level 2 rankChampion Level 2

    Hello David91,

    TC should display the new script with a '+' next to it indicating it is being tracked in git and that it exists in the file path (ie has been created an empty script file in the file path).  Are you seeing this?  The Script.tcScript file is not updated until you save the project.  This is normal.   

    If git isn't detecting the new file you likely have an issue in git.

  • rraghvani's avatar
    rraghvani
    Icon for Champion Level 3 rankChampion Level 3

    Unfortunately, that is the expected behaviour of TestComplete! Always remember to press "Save All Changes" button, as "Save the Selected Element" just saves that particular file. This will ensure that the Project Suite has been saved with the appropriate changes.

  • scot1967's avatar
    scot1967
    Icon for Champion Level 2 rankChampion Level 2

    Create a new script unit and then check the file path.  TC should be creating the empty script file there.  If it isn't then something is wrong in TC.

  • scot1967's avatar
    scot1967
    Icon for Champion Level 2 rankChampion Level 2

    When I add a new script (e.g. MyTest.js) to the Script folder using the TestComplete interface, it is not immediately written to the Script.tcScript file. As a result, Git doesn’t detect any change, and the project structure is incomplete for others pulling the repo.

    Another point to consider...  Again, yes, this is normal.  Typically changes won't be committed to the repo for others to pull until a commit is done. If a commit is done prior to a save TC should display a prompt.

     

  • scot1967's avatar
    scot1967
    Icon for Champion Level 2 rankChampion Level 2

    Now that I’ve switched to using an external Git client (Fork), the behavior is different. When I add a new script file, I can see the file is created and marked with a “+” icon in TestComplete, meaning it’s new and tracked. However, unless I manually save the entire project, the Script.tcScript file does not get updated, so Git doesn’t detect any change in the project structure.

    If you are using this client to perform your commits you will need to save the project before you commit.