Creating subjects using the Primary Form

When testing on a Medidata Rave EDC URL, using TG_UAT version 21 or higher, there are steps to create subjects by entering data directly into the Primary Form. These steps do not use the custom functions in the 'TG_UAT' draft and do not use Rave Web Services; data is entered via the browser.

See also

There are other steps for creating subjects, see Test Case Subjects.

The steps follow the same actions that a user would perform in the browser, for example:

 1 Feature: Create subject using primary form
 2
 3   Background:
 4
 5   Scenario: Create subject
 6     Given I am logged in with role "Batch Upload"
 7     When I open the primary form to add a subject
 8     And I enter data on the open form
 9       | Field       | Value  |
10       | SUBID[0]    | 123456 |
11       | INITIALS[0] | ATN    |
12     And I save the primary form and the subject is created

After logging in the primary form is opened in preparation for adding a new subject, then data is entered into fields on the form which has been opened, it is saved, and we verify that the subject has been created.

The 'enter data on the open form' step is similar to other data entry steps except that only the Field OID and record position are required. The folder and form do not need to be specified because we are already on a form open for data entry.

Modifying Primary Form data for an existing subject

Once a subject has been created the Primary Form data can be modified by opening the form again, without the intention 'to add a subject':

 1 Feature: Create subject using primary form
 2
 3   Background:
 4
 5   Scenario: Create subject
 6     Given I am logged in with role "Batch Upload"
 7     When I open the primary form to add a subject
 8     And I enter data on the open form
 9       | Field       | Value  |
10       | SUBID[0]    | 123456 |
11       | INITIALS[0] | ATN    |
12     And I save the primary form and the subject is created
13     When I open the primary form
14     And I enter data on the open form
15       | Field       | Value  |
16       | INITIALS[0] | ATX    |
17     And I save the open form

Supported fields

Data can be entered into fields with Control Types of Text, LongText, DateTime, CheckBox, DropDownList, SearchList, RadioButton, RadioButton (Vertical).

Data can be entered into Dynamic Search List fields only after the subject has been created and the Primary Form is opened again. This is consistent with behaviour in Medidata Rave.

Data cannot be entered into File Upload or Signature fields.

Data can only be entered into standard fields with record position 0.

Errors when creating a new subject

When trying to create a new subject there might be validation errors when the form is saved, for example if there is a duplicate subject name edit check. The 'subject has not been created' step can be used to verify this. The queries displayed on the form after saving will be displayed in the test results. At the moment there are no test steps to verify which queries have been opened.

 1 Feature: Create subject using primary form
 2
 3   Background:
 4
 5   Scenario: Create subject
 6     Given I am logged in with role "Batch Upload"
 7     When I open the primary form to add a subject
 8     And I enter data on the open form
 9       | Field       | Value  |
10       | SUBID[0]    | 123456 |
11       | INITIALS[0] | ATN    |
12     And I save the primary form and the subject is not created

Identifying fields on the form

TrialGrid will use the PreText label to identify each field on the form. For this reason it is essential that the draft loaded into TrialGrid matches the version being used for testing in Medidata Rave. If there are differences in field definitions, then there may be test failures because TrialGrid cannot locate the field.

If there are several fields on a form which have the same PreText label TrialGrid will use the field ordinal to identify which field is which. If these fields also have dynamic field visibility edit checks then TrialGrid might not be able to locate the desired field - though a human user would also not be able to do this.

Valid sequence of steps

The Test Case editor will validate that the sequence of actions is valid.

For example, this would not be valid because the form needs to be saved before the subject is created:

 1 Feature: Create subject using primary form
 2
 3   Background:
 4
 5   Scenario: Create subject
 6     Given I am logged in with role "Batch Upload"
 7     When I open the primary form to add a subject
 8     And I enter data on the open form
 9       | Field       | Value  |
10       | SUBID[0]    | 123456 |
11       | INITIALS[0] | ATN    |
12     Then I should see that a subject has been created

This example is also invalid, because the form has not been opened before data entry:

 1 Feature: Create subject using primary form
 2
 3   Background:
 4
 5   Scenario: Create subject
 6     Given I am logged in with role "Batch Upload"
 7     And I enter data on the open form
 8       | Field       | Value  |
 9       | SUBID[0]    | 123456 |
10       | INITIALS[0] | ATN    |
11     And I save the open form
12     Then I should see that a subject has been created

Note that if you add a login step in the middle of form data entry steps then any unsaved changes will be automatically cancelled. In the following example the data entry into the SUBID field will not be saved:

 1 Feature: Create subject using primary form
 2
 3   Background:
 4
 5   Scenario: Create subject
 6     Given I am logged in with role "Batch Upload"
 7     When I open the primary form to add a subject
 8     And I enter data on the open form
 9       | Field       | Value  |
10       | SUBID[0]    | 123456 |
11     Given I am logged in with role "CRC"
12     When I enter data on the open form
13       | Field       | Value  |
14       | INITIALS[0] | ATN    |
15     And I save the primary form and the subject is created

Field visibility

If there are fields which are not visible and will be made visible by data entry into other fields, there are test steps to check if a field is visible or not:

 1 Feature: Create subject using primary form
 2
 3   Background:
 4
 5   Scenario: Create subject
 6     Given I am logged in with role "Batch Upload"
 7     When I open the primary form to add a subject
 8     And I enter data on the open form
 9       | Field       | Value  |
10       | SUBID[0]    | 123456 |
11       | NOT_DONE[0] | 1      |
12     And I wait for field "REASON[0]" to be visible
13     And I enter data on the open form
14       | Field       | Value     |
15       | REASON[0]   | FORGOTTEN |
16     And I save the primary form and the subject is created

In the above example after entering data in the NOT_DONE field (entering '1' for a checkbox) the field REASON will be made visible and data can be entered into it.

You cannot enter data into a field which is not visible.

If the step to wait for the field to be visible is not included then it is likely that the test case will fail:

 1 Feature: Create subject using primary form
 2
 3   Background:
 4
 5   Scenario: Create subject
 6     Given I am logged in with role "Batch Upload"
 7     When I open the primary form to add a subject
 8     And I enter data on the open form
 9       | Field       | Value     |
10       | SUBID[0]    | 123456    |
11       | NOT_DONE[0] | 1         |
12       | REASON[0]   | FORGOTTEN |
13     And I save the primary form and the subject is created
14     Then I should see that a subject has been created

TrialGrid will wait for a default number of seconds to check if a field is visible or not. You can wait for a longer or shorter period of time between 0 and 3600 seconds:

 1 Feature: Create subject using primary form
 2
 3   Background:
 4
 5   Scenario: Create subject
 6     Given I am logged in with role "Batch Upload"
 7     When I open the primary form to add a subject
 8     And I enter data on the open form
 9       | Field       | Value  |
10       | SUBID[0]    | 123456 |
11       | NOT_DONE[0] | 1      |
12     And I wait up to 60 seconds for field "REASON[0]" to be visible
13     And I enter data on the open form
14       | Field       | Value  |
15       | NOT_DONE[0] | 0      |
16     And I wait up to 60 seconds for field "REASON[0]" to be not visible
17     And I save the primary form and the subject is created

Saving and cancelling data entry

The 'save the open form' and 'save primary form' steps will wait for a default number of seconds. You can wait for a longer or shorter period of time between 0 and 3600 seconds:

 1 Feature: Create subject using primary form
 2
 3   Background:
 4
 5   Scenario: Create subject
 6     Given I am logged in with role "Batch Upload"
 7     When I open the primary form to add a subject
 8     And I enter data on the open form
 9       | Field       | Value  |
10       | SUBID[0]    | 123456 |
11     And I save the primary form and wait up to 20 seconds and the subject is created
12     When I open the primary form
13     And I enter data on the open form
14       | Field       | Value  |
15       | SUBID[0]    | 123458 |
16     And I save the open form and wait up to 120 seconds

You can cancel data entry, i.e. click the 'Cancel' button on the form:

 1 Feature: Create subject using primary form
 2
 3   Background:
 4
 5   Scenario: Create subject
 6     Given I am logged in with role "Batch Upload"
 7     When I open the primary form to add a subject
 8     And I enter data on the open form
 9       | Field       | Value  |
10       | SUBID[0]    | 123456 |
11     And I cancel data entry
12     And I enter data on the open form
13       | Field       | Value  |
14       | SUBID[0]    | 654321 |

User permissions

The Medidata Rave user account used in the Test Case must have permission to add subjects and must have data entry permission. View or Entry restrictions will function as in Medidata Rave; fields which are view restricted to the user will not be visible and fields which are Entry restricted cannot have data entered into them. The test results will display errors if the user does not have the necessary permissions.