It's an Interview question: If each test case contains 8-10 lines within it. Then what would be the average time to automate them?

I think it depends on the following factors:

  1. Complexity of the module.
  2. Durability of the script adding (no. of try-catch block, Inputs from excel, etc)
  3. UI
  4. Dynamic elements
  5. PopUp
  6. Framework design
  7. Experience

And we may dicuss about the ROI

ROI = (Cumulative saving / Investment through automation)*100

what are the other things that need to keep in mind while removing an overall time effort to automate them?

  • 1
    +1 I think that's a great question that many people forget about to ask themselves. Perhaps because it is hard to answer... And perhaps the answer would show they wasted time that could be invested better.
    – dzieciou
    Aug 29, 2016 at 11:45

3 Answers 3


In addition to the existing answers, another factor in ROI is how often the test cases need to be run.

If automating the test cases will take you 500 hours, they need to be run once a year, and it takes an hour to run each test case manually, by the time the automation has "earned back" the initial development time, the software is likely to be obsolete.

If, on the other hand, you need to run the same test cases three times a day (after each build), then it's worth doing, because you will be into positive ROI within a year.

Other things you should consider:

  • Number of moving parts - how many different aspects of the software does your test case need to interact with? If you're checking straight database input, your test case will be simpler than if there is data manipulation downstream of the data entry. Similarly, entering data is a lot simpler than performing tax calculations.
  • Preconditions - the more things that need to be in place for your test case to run, the more complex your automation or framework needs to be.
  • Maturity of framework - I've worked in an environment where the framework was mature enough that adding a test case for a new feature could be as simple as one new function, one line of code to call that function, and half-a-dozen rows of data added to the run files and baselines. Without that, you're looking at a much longer time to automate and likely more repeated code.
  • Postcondition validations - the more changes the test case makes, the more validations you will need to perform on completion of the test case. You may have software that has a single button-click action to kick off a complex process with dozens of validations needed. That will take more time to automate.
  • Existing automation - it's often faster and easier to add to existing automation than to build from scratch. If you can make use of existing test harnesses, you can call and possibly expand on already built helper functions, which reduces your automation time.

Most Important

Don't forget to include time to test and deploy your automation. In my experience building it is the fastest part. Testing it to ensure it's stable and does not generate false positives or false negatives and getting it deployed to run on a regular basis takes a lot longer.

  • But still the question lies what average time it will take to automate 10 test cases. I know it always depends, but can we have a pre-determined list/table of all the data that we needed to remove the overall time effort to automate 10 test cases.
    – Sandeep
    Aug 30, 2016 at 8:12
  • 1
    @Sandeep, the average time it will take to automate 10 test cases is meaningless because it depends. The time to automate any one test case can be anything from an hour to months. With potential extremes like that, you're far better looking at the median time to automate or the mode time to automate.
    – Kate Paulk
    Aug 30, 2016 at 11:37
  • 2
    @Sandeep in an interview I'd say something like "For a basic test case where I have an existing harness to work with and no need to extend it, it would take me about x hours per test case. If there is any extra complexity, there's no way to estimate without more information"
    – Kate Paulk
    Aug 30, 2016 at 11:40

In interview they basically want to ask you about ROI

Here is the brief description:

Identify the parameters on which you will base your test cases as a candidate for automation.

Test case executed with different set of data, browser, environment,complex business logic, set of users, Involves large amount of data, dependency, requires Special data

Once you have identified all the granular level details, you can present them in the below way. We are now progressing to calculate the ROI.

enter image description here

*ROI = (Cumulative saving / Investment through automation)*100

  • But still the question lies what average time it will take to automate 10 test cases. For the data of test cases assume your table
    – Sandeep
    Aug 30, 2016 at 6:14
  • 1
    @Sandeep it totally depends on business logic and the complexity of test case. If there complexity is high then you can take 25% extra buffer time. Aug 30, 2016 at 6:52

As per my experience, it takes 1 hour to manually write the scripts of a test case with 8 to 10 steps and 1 day ( 8 hours) to develop the automation code for the same.

Eg: Login to Application is one step It may take 1 hour or so develp this functionality.

But still, the other factors given in all other answers can impact it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.