Selenium Test Test vs Test Suite vs General Use

How do I know what should be a test case and what is the set of tests in Selenium? Is there a general rule for this? I read the seleniumhq website a few others, but they only have some basic examples, while I want to test the whole site.

My questions, for example:

  • Let's say I'm testing several multi-step web forms. Should I do one set of tests and each step (in a web form) would be the only test case, or should all the steps be one of the test cases?

  • Let's say I created a web forum, and I want to test several of its functions. Make a test suite and each test case test each function (or several cases for each function) OR I will have many test cases, and each set will test one function with several test cases.

  • What should I do if I have a form containing 5 checkboxes - each of them can be explicitly clicked or not. This may have some consequences when I submit the form. So, theoretically, there are 2 ^ 5 = 32 possible threads of execution. Should I test all 32? Or maybe I just need to check each checkbox separately to simplify things. When can / should be simplified, when not? (provided that the flags MAY be somehow connected).

  • Is there a test case in every function that tests both positive and negative results? For example, I should just focus on the right workflows - for example, submit a valid form and see if the site did what I asked (worked) OR also send an empty form and check if an error message appeared.

Can you answer them by giving some practical examples (if necessary)? - perhaps using some (StackOverflow?) sites as an example.

+6
source share
1 answer

Answer to 1 and 2:

I think this is more a test design problem than selenium. Consider Selenium as a tool that manages the browser / website as a user. It simulates a user click on a page. To find out what a test case is and what test suite you need to think about the features of your web application that you want to test. Let's say you have an online store, than in one test case you can check the following use case:

  • User puts articles in the basket
  • the user enters his data (name, etc.)
  • the user receives a summary of his order
  • user confirms order

It depends on your application, which workflows or features you want to test. I would consider a test suite for the entire project, so one suite for one web application. And this application has many test cases. Each test case is a precedent.

When creating your test suite, consider some design patterns, such as ui-mapping, page object design, and consider the benefits of a test management system (such as TestNG in Java). Here are some links to this:

Answer to 3 and 4:

This is similar to 1 and 2. It is always a question of WHAT you want to check. Or the question that your project manager wants you to test (or the client). Every functionality that is important and should work should be tested.

+6
source

Source: https://habr.com/ru/post/908619/


All Articles