Forum Discussion

TomB's avatar
TomB
New Member
2 months ago

Amount of Effort to Maintain Keyword Tests.

Can anyone provide me with feedback on how difficult and how time consuming it is to update my keyword test when the application being tested changes?

  • JDR2500's avatar
    JDR2500
    Frequent Contributor

    I don't think that question can be answered.  Part of it is test design, but a lot of it is the scope of application changes you're talking about.  Adding or moving a combo box should be no big deal.  

    There are features in TestComplete intended to mitigate these issues.  For instance, using Name Mappings to reference objects.  If you use name mappings consistently in your keyword tests and scripts, then you may only need to make a single name mapping update to resolve a problem caused by a change in the application.

    However, something that goes hand in hand with that is choosing the name mapping identification properties wisely.  If one of your properties is an index (e.g. combo box "2") and the index changes because of a UI change then your tests are busted.  Indexes = bad, XY positions = bad, unique static properties like an ID will be much more robust.  

    Also, put your frequently used functions in a single script/keyword test and call it from other tests.  For instance, we have a shared routine for opening test files.  All of our tests that need to open a test file use it.  If something changes with that UI, then we only have to fix it in one place.  We have dozens of these shared functions.  

    If your software engineers are inclined to throw out large portions of the UI and start over, then the situation could be untenable.  When we are proposing UI changes we assess the impact to our automated tests as part of the planning.

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    Agreed with JDR2500, there's no suitable answer for this. Either update the keyword tests or scripts, or do manual testing!

  • Are you new to TestComplete and trying to figure out if you should create all your tests using scripting or using Keyword testing? Are you new to automated testing and trying to get best practices?

    Regardless of whether you write your tests via keyword tests or via script ... the amount of work you will have to do to get your tests to pass again (once the application being tested goes through code changes) very much depends on what is being changed in the application (being tested) as well as how you design your tests (just like already stated by others who have replied).