Forum Discussion

mfoster711's avatar
mfoster711
Regular Contributor
9 days ago

Using AI to write scripts

Has anybody tried using AI to help write their scripts for TestComplete?

I have been researching CoPilot Github and Claude Code as AI tools to assist with coding. Both have integrations that work with VS Code or Pycharm (I using python). 

I was considering using VS Code or Pycharm to write and edit scripts so I can then take advantage of AI. But, you can't run your scripts from VS Code or Pycharm. I would have to bounce back and forth between IDE's and not sure if this is worth the hassle.  

Has anybody tried this and have any recommendations on how to best use AI with scripting?

4 Replies

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

    Personally, I don't think it's necessary to rely on AI to write automation scripts, as scripting is fairly easy to do on your own. However, when working with complex code that involves concepts like Classes, Polymorphism, Inheritance, Encapsulation, etc., in Object Oriented Programming languages like Python, AI can be extremely helpful for guidance. It saves you from having to think about how to create and pass parameters to objects, but relying on AI too much can also make you forget the fundamentals of programming.

    There's no official SmartBear plugin available for Visual Studio Code. Additionally, there are limitations when using Python in TestComplete, so code written in VS Code may not work seamlessly in TestComplete.

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

    One thing to consider is how TestComplete scripts are typically structured. In many projects, a large portion of the script (often 70–80%) is made up of interactions with NameMapped objects β€” clicking controls, setting values, checking states, etc. That type of code is very tool-specific and already fairly declarative.

    Because of that, using an external IDE with AI assistance can feel like overkill for pure UI interaction, especially when you have to switch back and forth between IDEs and still rely on TestComplete to run and debug the scripts.

    Where AI tools may add more value is outside of direct UI actions β€” for example:

    • Helper or utility functions
    • Data-driven logic
    • String/file handling
    • Simplifying or explaining more complex control flow

    In those cases, selectively using AI to assist with small, focused pieces of logic may be more practical than trying to author entire TestComplete scripts in an external IDE.

    πŸ€– AI-assisted response
    πŸ‘ Found it helpful? Click Like
    βœ… Issue resolved? Click Mark as Solution

  • mfoster711's avatar
    mfoster711
    Regular Contributor

    A few notes about our setup:

    • We don't use namemap. It is too slow and clunky to work with. We have other methods to identify fields. Also, using namemap locks us into TestComplete
    • We aim to keep all of our TestComplete specific logic in one class. Everything else is standard python
    • TestComplete's IDE is a decade behind other tools and needs a major upgrade. This is one of the main reasons we are looking to use other IDE.
    • rraghvani's avatar
      rraghvani
      Icon for Champion Level 3 rankChampion Level 3

      NameMapping was a good idea at the time, but it became a nightmare to maintain once it grew huge, and sometimes it would get corrupted. I've moved away from NameMapping and now use the Find and FindAll methods. If SmartBear could create a plugin to be used in VS Code, that would make things so much easier. However, I really don't see that happening ever!