3. Quick 5-Minute Guide

You can define a new test case, run and debug locally, execute on the cloud and get a report of the execution by following the steps below:

 

Creating Test Suites

 

Before creating a test case, you need to create a folder which arranges content inside your account based on different aspects of your project. Once folders are created, you can also create test suites inside folders where you can collect your test cases that belong to particular actions/goals you would like Subject7 to perform.

1- Hover over Flows and click Tests to open Test Library window.

2- Click + Add icon on the Tests window to add a new folder and provide a name for your folder.

3- Click on the name of the newly created folder to navigate inside it.

4- Click + Add icon on the Tests window, select Test Suite and provide a name for your suite.

5- Click on the name of the newly create test suite to navigate inside it.

Tip

The Name field color is pink to indicate that this is mandatory to enter.

 

Creating Test Cases

 

Test Cases are the place where you author your automated/manual/hybrid tests which includes steps and commands. Creating test cases is done as follows:

1- Click on + icon after navigating inside your Test Suite to create a new test case

2- Click on Automated to create an automated test.

3- Provide a Name (and metadata if you would like) for the test case in the New Test Case and click on the Steps tab to view the steps/command layout.

 

Adding Commands to Steps

Once your test case is created, you will need to add commands to each step to perform the needed action. Begin your first step as follows:

1- Click on the blank step (Select Command…) to activate the right panel where you can select a command

2- You can use Search or Filter By sections to find the command easily. You can also use your Up and Down keyboard keys to go up and down in the command selection screen. When find the command you want to use, you can use Enter keyboard key to select it.

3- After selection, you will see the options associated with the command you chose where you can make modifications for this command to run successfully.

4- To add another step, a blank step is automatically added for you after selecting any command.

5- You can also use the floating action palette to select from the displayed options or hover over the step (down arrow) to show additional options (shown in the video below)

6- For some commands such as Click, you can either use a Web Locator or add an Inline XPath. Web Locators allow you to store your XPath and use it in several test cases, so that if you change the XPath in the future, all of these test cases will use the new one. Whereas Inline XPaths do not force you to create web locators and you can simply add the XPath and move to the next step. You can select a previous locator from the drop-down list next to it. However, if you have not defined one, you can click on the + icon next to the drop-down list to define your locator (To learn how to define a locator, go to Create a New Locator/Element). To define an XPath for the test case to locate this object and click on it, you can use our Smart XPath/CSS Generation Engine to generate an XPath and add it to your step/locator.

Tip

You can use Custom Caption option which can be found on all commands to enter a readable description of the test. When you close the step, you will notice that the caption has changed on the Test Case screen. 

7- Let us use a simple command like Goto_URL. You can simply enter a URL in the URL field

8- To add another step, hover over your step and click on the Add after

9- Enter another simple command such as Fill

10- The Fill Options screen will appear where you will select a locator or add an Inline XPath and enter a Value

Tip

The locator here has been defined using an XPath.

 

 

Floating Action Palette

The floating action palette allows you to configure your steps as follows:

  1. Create Group: Allows you to create a group from one or more steps for the purposes of organizing your test visually. These groups can be named and also allow you to expand or collapse them, which makes long tests look cleaner.

  2. Ungroup: Allows you to ungroup a previously created group

  3. Create Function: Allows you to create a function from one or more steps which you can use in other test cases as well. Refer to this section of the guide to learn more about functions

  4. Move selected up: Allows you to move one or more steps up

  5. Move selected down: Allows you to move one or more steps down

  6. Cut: Allows you to cut steps so you can paste them elsewhere. Highlight will be displayed around the cut steps for easier visibility.

  7. Copy: Allows you to copy steps so you can paste them elsewhere. You will see highlight around the copied steps for easier visibility.

  8. Paste: Allows you to paste steps after cutting or copying them.

  9. Change Command: Allows to to change the reset the step to select a different command. If your step was already using an XPath or Locator, the new selection will use the same one if the command accepts XPaths or Locators.

  10. Delete selected: Allows you to delete selected step(s).

  11. Mark to Skip: Allows you to skip a currently selected step. This will also affect cloud executions.

  12. Set Breakpoint: Allows you to set a breakpoint on which execution will step. Only affects local execution and does not affect cloud executions.

  13. Add Comment: Allows you to add a comment to a selected step.

 

Multi-Step Editing Mode

 

You can select multiple steps in order to edit them. The options of these individual steps will appear if the selection is up tp 3 steps which allow you to modify several options at once. While the Edit icon will appear on next to any selected step which will take you to the individual step to edit it.

If the test case is locked, you may only be allowed to view the test but not edit it. In case this, selecting multiple steps will display View instead of Edit.

 

Running a Test Case Locally and Debugging

 

When your steps are ready, you will need to run your test case locally to test that it meets your needs and debug any issues that might occur during execution. It also helps in predicting possible outcomes so you can prevent any unnecessary errors or issues to occur.

1- Next to your profile name, hover over the arrow next to red icon and click the Download Subject7 Player link.

2- Alternatively, you can click on the Run now button which will allow you to download the local player.

3- Follow the instructions in the article:How to Run a Test Case Locally . Once the executable installation is complete, run the Subject7 Player application to connect. The red icon will change to green and you can now run your test case.

 

Creating Execution Sets

 

In order to prepare your test cases to run in the cloud on a schedule, you will need to create an execution set and define various parameters before starting cloud executions. 

1- Hover over Executions and click Execution Sets

2- Click + from Execution Sets window to create a new execution set

3- Provide a name for your execution set, select your pool of choice, select your other parameters of choice or leave them at default values.

4- Click on Tests Data Selection tab to select your Test Case and Data Sets (Explained further here).

5- Drag and drop test suites or test cases from the Tests on the left-hand side to the Selected Test Cases in the middle

6- In Scheduling Options, you can create a schedule to run your execution set using Cron Maker.

7- Click Save on the lower right corner.

8- Click on each test case shown in the middle to see if there are any Templates shown on the right-hand side.

A- For each Template shown on the right-hand side, select at least one Data Set from the Data Set drop-down

B- Perform this step for every test case shown in the middle

9- Click on Save or Save & Close on the lower right corner.

 

Running an Execution Set in the Cloud

 

Running an execution set in the cloud can be done with a schedule as explained above, but you can also run it individually as below:

1- Select an execution set by clicking on the checkbox next to Execution Set name and click on Cloud Run.

2- Select Yes on the confirmation popup window.

Viewing Execution Reports (Results)

 

Viewing execution results after running them on the cloud can be done as below:

1- Click on the name of the Execution Set

2- Click on the name of the Execution

3- Click on the arrow next to the test case name. The test case will appear with an ID of the execution.

4- Click on the arrow to the left the ID to see the details of the execution.

5- You can also click the Eye icon under Artifacts and click the View video link to show the recording of the execution or click the View images link which will generate an image if there are failures to debug.

 

Modularizing Steps

 

Creating Functions

Some steps in your test cases may be repetitive or similar in a way that you may not wish to create them over and over again whenever you create a new test case. To prevent that, you can group one or several steps into a function in two ways:

Method (1):

1- Hover over Flows menu and click Functions

2- Click on + Add icon to add a new function

3- Provide the name for your function on the New Function menu and click Steps tab to view the steps/command layout.

4- Create the needed steps with commands and define any locators/Inline XPaths.

6- Click Not Saved to save your function



Method (2):

1- Create all the steps that you would like to group into a function.

2- Select all the steps by clicking on the checkbox next to each step. Alternatively, you can select the first and last and range.

3- Click the Create a function icon in the test case floating action palate and enter a name for your function.

4- A confirmation prompt will appear asking you to replace the selected steps with a function step. If you select No, the function will still be created for you to use later.


Using a Function:

To use a function inside a test case you have created before, select the Call command in a step and then select the desired function. When execution occurs, the test case will execute the steps in the same order they have been arranged inside the function. The image below shows a Call command used with a function:

 

Creating Data Templates (Data-driven testing)

 

If you have data which is needed in several test cases (such as log in information), you can create data templates and add data sets to them to save this data instead of hard-coding it in steps or entering it manually in every test case. That way, you can simply inject a data set in any field in your steps. You can do that as below:

1- Hover over Repository and click Data Templates

2- Click + icon to create a new template and provide a name for it

3- Provide a name for your Field and select the Type (Normal or Password). If password is selected, it will be encrypted throughout the entire usage. You can add or remove fields as much as you like by using  and buttons under Actions.

4- Click on Timestamp checkbox if you would like the values associated with this field to be unique each time you run the test case. Once checked, a unique time stamp will be appended to the end of the value each time.

5- Click Save.

6- Click on the checkbox next to Data Template name and click on Datasets (Alternatively, you can click Edit and then go to DataSets).

 

Method (1): Selecting a data template and clicking View Data Sets icon from toolbar:

Method (2): Opening a data template and clicking Data Sets option:

7- Click on New to create a new Dataset or Upload to upload datasets using a CSV file. Please refer to Uploading/Importing DataSets for more information on how to upload datasets.

8- Click Save or Save & Close

9- Go back to the created test case and replace the hard-coded test data with the template you created.