Suppose we have 25 radio buttons and if we click 1 to 3 radio buttons it should move to some other page and if we click 4 to 8 radio buttons it needs to move some other page and if we click 9 to 13 radio buttons it needs to move some other page and if we click 14 to 18 radio buttons it needs to move some other page and above 18 some other page.. What are the maximum test cases can we write for this scenario...

  • What was your answer? And how did you get there? – Niels van Reijmersdal Sep 16 '16 at 12:19
  • 3
    The maximum number is infinite. The correct question should be How many are appropriate to cover the requirement. The absolute minimum would be 25, one for each button to confirm it went where it should go. And even then you'd need to provide additional information to be sure that was correct. Do you have to click 3 buttons to move to the first page, or just one of the first three? If you click 3 buttons and have moved to the next page...how do you click the 4 to 8 buttons? If it's simply based on how many buttons you have clicked you need to cover all the button combinations...etc – Dave Sep 16 '16 at 12:24

During an interview, it is important to ask questions. From what you have described, I have come up with an abstract diagram:

Abstract diagram

For your question, you could have asked:

  • From management perspective, how much time do we have to write test cases?
  • From business perspective, does each of the page have equal business value?
  • From technical perspective, what does "click 1~3 buttons it should move to some other page" mean? Do we need to click button 1 OR button 2 OR button 3 in order to navigate to a page or do we need to click button 1, 2 and 3 in order to navigate to a page?
  • From technical perspective, can you navigate back and forth? If you can, how? E.g. what is the layout of this webpage / application?

In case the interviewer does not answer any questions, then you will need to make assumptions.

  • It is not the answer that you come up with matters, it is HOW you come up with your answer. So state your assumptions and then describe your test cases to them.

Below is a sample scenario:

enter image description here

  • We start from the page in the middle
  • We can navigate to five different pages by providing different button combinations
  • We can always see button 1~25 all the time, e.g. we can navigate to other pages from any page by providing button combinations
  • Page navigation tests, from page 0 to page 1, from page 0 to page 2......; from page 1 to page 2, page 1 to page 3......; from page 2 to page 1, from page 2 to page 3 ...... In total, there will be 5 + 4*5 = 25 test scenarios.
  • Assuming we need to click all radio buttons in order to navigate (I really do not see why can navigate by checking only 1 radio button).
  • 2
    +1 to the approach defined above. Interviews mostly are to check how you work things out more than what you do for the given situation. To be a better tester you need to be able to think and question stuff, dig out facts and arrive to conclusions! – IAmMilinPatel Sep 19 '16 at 5:17

****I think that correct answer is 5** test cases, because 1 test is for pages 1 ,2 and 3, second test is for pages 4,5,6, 7,8 and so on. This technique is equivalence partitioning.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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