Test Case Generation

Automatic generation of test case is the whole idea behind NetTest. It processes real user sessions captured in NetVision, uses ML techniques (which consumes knowledge base collected so far), and generates quality test cases. NetTest’s core concepts like Template, Page state, and others help in generating test suite which covers all possible flow taken by real users.

Here, a user can create a new test case, check the history of test cases, and perform various other actions, which are described below.

New

To create a new test case, follow the below mentioned steps:

  1. On the left menu, go to Test Case Generation > New.

2. The Test Generation page is displayed.

The user needs to provide the following details to create a test case based on system defined configurations:

  • Data Source: Select the data source from which the user wants to fetch the session.
  • Start Time and End Time: Provide the start time and end time for which the user wants to dump the partition ID data.
  • Click Apply to create the test case.

The user can also define the custom test case category by clicking the ADVANCE FILTER button.

To change the custom configuration, the user needs to provide the following additional details:

  • Maximum number of sessions for test case identification – It is the maximum number of sessions a user wants to record for a test case.
  • Minimum number of pages in sessions – The minimum number of pages a user wants to dump in a session.
  • Threshold percentage of Test Case frequency for priority 1 to 4 – A user can set the priority from 1 to 4 for the percentage of a page which needs to be recorded.
  • Test Case Generation Mode – There are two modes, Functional and Replay. In the Functional mode, a user can set all the data sources functionally.
  • Event – The events that are present in the NV database are displayed in this drop-down list. A user can select an event which is suitable.
  • Transaction Mode – In this mode, session will split on transactions and each transaction will be considered as a separate session.

History

This section displays the history of the generated test cases. To view this, go to Test Case Generation > History.

The following window is displayed, which displays the details of the generated test cases such as the run at time, start & end time, number of identified test cases, in repository, repository candidate, processed NV session, data source, and type.

Clicking any row of test case displays the summary and more details of that test case in tabular format as shown below.

When a user clicks any of the numbers in these tables, a new table is displayed that consists of details such as test cases, priority, categorization rule, type, and actions. For example: In the Total Cases column in the Details table, if the user clicks ‘4’, a new table is displayed that consists the details mentioned above.

To open the script corresponding to the test case, click the  icon. A pop-up window is displayed that contains the ‘flow.c’ script file.

Clicking the  icon opens a pop-up window in which the user can view the complete sequence of the test case.

The user can also compare two test cases. To do this, select the check boxes corresponding to the test cases, and then click Compare.

Both the test cases are compared at their respective start and end times. As a result, two results are displayed – ‘Test Generation A’ and ‘Test Generation B’. The test cases that are present only in ‘Test Generation A’ are displayed in one table whereas the test cases that are present only in ‘Test Generation B’ are displayed in another table. Anything common in both the test generations is displayed in a separate third table. An example is shown below:

The user can view the complete sequence by clicking the  icon.

Templates

A template is helpful in generation of test case, test data mapping, and validation of test case execution. A user can view the templates by going to Test Case Generation > Templates.

The template window is displayed. To add a template name, the user needs to select ‘Page’ and ‘Template’ from the drop-down lists, and then click  icon. Provide a template name, and then click Save.

A user also has the option to compare two templates of a page. To do so, first the user needs to click the ‘Compare Mode’ button. Then the user needs to select the ‘Page’ and the two templates that need to be compared. Click Compare.

The user can view the comparison as shown below.

Archived Tests

The test cases that are not required to be displayed but should not be deleted too are archived. To view such test cases, go to Test Case Generation > Archived Tests.

The following window is displayed that contains a table having a list of all the archived test cases. The table contains details such as test case ID, test case, priority, categorization rule, and type.

Import TestCase

NetTest provides a user the option to import test cases from any file or server. To import test cases, go to Test Case Generation > Import TestCase.

The following window is displayed. It has two sections – ‘Import TestCases’ and ‘Imported TestCases Detail’.

Import TestCases

In this section, there are two tabs – File and Server.

File

Clicking the File tab allows the user to import test cases from any file present in the local drive. The user needs to choose a file (in .tar or .zip format) from the local drive. Then select the available tags and priority (P1/P2/P3/P4/P5) from the drop-down lists. Click Submit.

Add a Tag

Tag (or rule) is either system-defined (which can be viewed in the Category Rules section) or user-defined. Here, the user can also add a tag by clicking the  icon. The ‘Create Rule’ window is displayed.

  1. Provide the name of the rule.
  2. Provide the sequence. A sequence is the flow of how a user navigates through a webpage. To add a sequence, follow the below procedure:
    • Select a page from the drop-down list, and then click Add. This is a mandatory field. Two pages should not be added consecutively.
    • Enter an action in the text box, and then click Add. This is an optional field. A user can have a sequence that contains only a page, not an action.
    • Continue the steps ‘a’ and ‘b’ until the desired sequence is achieved.
  3. When a user selects the Follow Sequence check box, this sequence is followed during test case generation.
  4. Choose ‘All’ option to match the complete sequence. Or choose ‘Any’ option to match any part of the sequence.
  5. Click Save. The tag is added in the drop-down list.

Server

Clicking the Server tab allows the user to import test cases from any local server or a remote server.

Local Address

To import test cases from any local server, do the following:

  1. Click the ‘Local Address’ button.
  2. Select a script from the drop-down list. Or record a script by clicking the icon. The ‘Record Script’ window is displayed. Provide the script name and URL, and then click Start Recording.

3. Select a tag from the drop-down list. Or add a tag in a way similar to as mentioned in the File section.

4. Select a priority (P1/P2/P3/P4/P5) from the drop-down list.

5. For any advance setting, click the icon next to ‘Advance’. The Advanced Filter Setting window is displayed.

    • Here, the user can select multiple scripts from the drop-down list.
    • Select multiple tags for all the selected scripts or select different tags for different scripts.
    • Select one priority for all the selected scripts or select different priorities for different scripts.
    • Click Submit.

6. Click Submit.

Remote Address

To import test cases from any remote server, do the following:

  1. Click the ‘Remote Address’ button.
  2. Provide the IP address of the remote machine, and then click Connect.

3. Select a controller from the drop-down list, and then click ok. All the scripts available on that controller are fetched.

4. Select a script from the drop-down list.

5. Select a tag from the drop-down list. Or add a tag in a way similar to as mentioned in the File section.

6. Select a priority (P1/P2/P3/P4/P5) from the drop-down list.

7. For any advance setting, click the icon next to ‘Advance’. Then configure the advanced settings as done in the ‘Local Address’ section.

8. Click Submit.

Imported TestCases Detail

Here, a user can view all the test cases that are imported and their details, such as test case ID, script name, test case, priority, categorization rule, and type.

The user can click icon to view the sequence of that particular test case. The user can also select the check boxes to delete (), edit () or export () the test cases. Multiple test cases can be deleted or edited at once.