YAML Execution
Using YAML, you can run a test scenario in NetStorm without creating any script and scenario. For running a test, you only need to provide the configuration for both script and scenario in the YAML file and then execute the file.
You can create a YAML file in one of the following ways:
- Manually create a YAML file
- Upload an exisiting YAML file
Guidelines for using YAML
Refer to the following guidelines while executing a YAML file:
- Upload the Body file and Data file and specify the content of the body as String.
- Specify the parameters in key = value
- Upload file from client machine only.
- Do not specify the METHOD in YAML file. If the user uploads the Body file, the METHOD will be POST otherwise it will be GET. To define other methods (PUT/DELETE), the user needs to define that value. method: <Put/Delete>
- Provide the parameter values by executing some query on database to get the data in a file and use that data in the body as parameter. The user needs to upload Shell/Python script only where the user will specify the database info and query. File extension will be .sh or .py only.
- If body is of one line, the user can put it in the content and if it is multi line, it must be in a file.
- Headers should be separated by comma (,).
- Validation is done at the server side and validation error (if any) is displayed in the UI. The validation is done on the basis of Syntax error, Case Sensitive, and No duplicate entries
Note: If validation fails, an error is prompted to the user on UI. If the user clicks the Execute button without validating the file, the YAML file is internally validated first and then the test is executed.
Manually Creating a YAML File
You can manually write a YAML file in NetStorm or simply copy the contents of a YAML file to execute a test scenario.
To manually create a YAML file:
- Log into NetStorm using your credentials.
- Select View > Scenario.
- Click the Create button to create a new scenario. The Create Scenario window is displayed.
- Select YAML from the Scenario Format drop-down list.
Figure: Create Scenario-YAML
5. Select a project and subproject.
6. Specify the scenario name.
7. Click Next.
8. A YAML window is displayed with a text area having YAML format where you can specify the configuration.
Figure: YAML Window
9. Copy and Paste the content of the YAML file OR write manually in the text area.
10. Click the Validate button to ensure the validity of your YAML file. Validation is done at the server side and validation error (if any) is displayed in the UI. The validation is done on the basis of Syntax error, Case Sensitive, and No duplicate entries
Note: If validation fails, an error is prompted to the user on UI. If the user clicks the Execute button without validating the file, the YAML file is internally validated first and then the test is executed.
Uploading a YAML File
You can upload an existing YAML file into the body or any data set files.
To upload a file:
- Log into NetStorm using your credentials.
- Select View > Scenario.
- Click the Create button to create a new scenario. The Create Scenario window is displayed.
- Select YAML from the Scenario Format drop-down list.
- Select a project and subproject.
- Specify the scenario name.
- Click Next. The YAML window is displayed.
- Click the Upload File button.
Figure: Upload File Dialog Box
9.Click Browse.
10. Select the files to upload (body file and data file), as shown in the following figure:
11. Click Close.
Syntax:
configuration: This section specifies the test identification by username, appname, and test name.
configuration:
username: <UserName>
appname: <ApplicationName>
testname: <TestName>
execution: This section specifies the execution model which could be the user model or session rate model. In the case of the user model, provide the number of users while session per minute in the session rate model. Here, scenario-name is the name of scenario that is described in the scenario part.
execution:
-concurrency/ session-per-minute: <Number Of Concurrent users Max 10000 or Session per minute>
duration: <hh:mm:ss>
ramp-up: <hh:mm:ss>
ramp-down: <hh:mm:ss>
scenario: <scenarioname>
scenarios: This section specifies the details of url/api to be executed.
scenarios:
<scenario name mentioned in execution section>
file-parameters: This is optional and required only on using a file for body/payload or using any data file(s) for a file parameter.
file-parameters:
-parameter-name: <parameter name separated by comma>
file-name: <data file having comma separated value>
       Note: file should NOT have any header line.
 headers :This section specifies all header’s name value pairs as name:value
 headers:
 <name>: <value>
requests: This section specifies url/api, label, body (POST type url) and content check if any.
requests:
-url: <url>
label: <labelName>
body-text: <payload in single line>
content-verification: <Text or string to be validated in response>
Example:
The following sample YAML file consists of three POST type APIs. In this sample file, execution is designed to generate 5 sessions per minute for each API.
configuration: username: Anjali appName: CavWebservices testname: TestNew1 execution: - session-per-minute: 5 duration : 00:03:00 scenario: WebserviceTest1New - session-per-minute: 5 duration : 00:03:00 scenario : WebserviceTest2New - session-per-minute: 5 duration : 00:03:00 scenario : WebserviceTest3New scenarios: WebserviceTest1New : headers:    accept: application/json    content-type: application/json requests :  - url: http://68.235.60.35:9002/account/balanceEnquiry    label: BalanceEnquiry    body-text: {"RequestType":"ViewBalance","Version":"V1","AssociateAccount":[{"accId":"12365498","encryptedsecuritycode":"MTIzZXJkdA==","phonenum":"8895945456","originator":"cavisson"}]} WebserviceTest2New : headers:    accept: application/json    content-type: application/json    x-pfl-experimentation: V2 requests:  - url: http://68.235.60.35:9002/pfl/api/itemAvailability/details    label: ItemAvailability    body-text: {"clientXrefDocument":null,"batchCode":"1","reservationNumber":"0","sellAssociateNumber":"01005293","itemList":[{"resgistryNbr":null,"shipToState":"VA","shipMethod":"3","quantityRequested":"1","countryCode":"840","unitPrice":"24.99","requestedOrderMethod":"MO","filLocationNumber":null,"upcNumber":"719812261911","itemAppId":"MCOM","shipToZipCode":"22102","shipMethodOptions":"1","lineNumber":"1","iaType":"MO","priceFlag":"true","priceStatus":null},{"resgistryNbr":null,"shipToState":"VA","shipMethod":"3","quantityRequested":"1","countryCode":"840","unitPrice":"23.99","requestedOrderMethod":"MO","filLocationNumber":"5494","upcNumber":"719812280813","itemAppId":"MCOM","shipToZipCode":"22102","shipMethodOptions":"9","lineNumber":"2","iaType":"MO","priceFlag":"true","priceStatus":null}],"racfId":"yc03466","requestType":"R","referenceId":"271","clientFunctionName":"GA","orderId":"186461346","sellLocationNumber":"139"} WebserviceTest3New : headers:    accept: application/json    content-type: application/json requests:  - url: http://68.235.60.35:9002/pos/EnterprisePaymentServicesv2.0    label: EnterprisePaymentServices    body-text: {"RequestType":"Association","Version":"V2","AssociateAccount":[{"accId":"12365498","encryptedsecuritycode":"MTIzZXJkdA==","phonenum":"8895945456","originator":"cavisson"}]}
Performance Tool
The Performance tool enables you to view information about the YAML tests that were executed. For using the tool, Developer capability should be assigned to the user.
The Performance Tool window is displayed in the following figure:
In this window, you can view the following information:
- Analyze the tests executed in the last 7 days.
- View Summary Report, Performance Report, and Status (Pass/Fail) Report for each test executed.
- View Transaction data for specified executed tests.
- Display the list of scenarios available to execute.
- Add new YAML scenarios from this tool by clicking the Add New button.