Forum Discussion

Nformation's avatar
Nformation
Contributor
10 years ago

Refactoring - Replacing operations in Keyword Tests

I've created a new and better function for closing my application at the end of each test. I'd like to update all existing tests, which all currently end with clicking 2 buttons. I cannot find a way to search-and-replace these operations with the new operation I'd like to use in their place. 

 

Below is an illustration of what I want to do.

 

newCloseScript.jpg

  • Good morning. Does anyone know if there is a convenient way of doing this?

    • Marsha_R's avatar
      Marsha_R
      Moderator

      I'm pretty sure there is not a convenient way of doing this.  I was hoping someone else would show up and prove me wrong.

      • Nformation's avatar
        Nformation
        Contributor

        It's very sad to see no suggestions and I fear you are right--there is no convenient way to update multiple keyword tests. This makes TestComplete very disappointing when it comes to managing large test suites.

  • From what I've seen of Keyword Tests, that's the one drawback.  They're not always the easiest things to edit.  You can't do a global search and replace like you could in standard JScript/VBScript code, and I don't know if the Global search even searches through the Keyword Tests.  I've viewed Keyword Tests like Record-AnD-Playback scripting:  good to see how things work, but I don't like using them for real development.

    • Nformation's avatar
      Nformation
      Contributor

      will_fetherolf, So do you manage your test suites completely in scripts? If so, I need to decide if I should do that, too... having scripts calling scripts would be easier to refactor, but not as easy to read.  It stinks that we have to make these tradeoffs with TestComplete.

      • will_fetherolf's avatar
        will_fetherolf
        Contributor

        I've been using TestComplete since version 2, so I use what's familiar to me.  I was on a project where someone had been using Keyword tests prior to me coming onboard with that project, and I found where I had to edit Keyword Tests cumbersome, and sometimes I ended up converting the Keyword Tests to script and abandoning the Keyword Tests just so I could work with them easier.

         

        If it were me, and I was starting from the ground up, I would not use Keyword Tests at all.  I know there are some people out there who find them useful, but I do not.  When I've looked at the Keyword Tests, they are merely a GUI skin on top of JScript or VBScript.  This GUI skin makes them difficult (for me) to work with. YMMV.