diff --git a/openecomp-ui/src/nfvo-components/input/validation/Input.jsx b/openecomp-ui/src/nfvo-components/input/validation/Input.jsx
index 16a0abc..3feb06d 100644
--- a/openecomp-ui/src/nfvo-components/input/validation/Input.jsx
+++ b/openecomp-ui/src/nfvo-components/input/validation/Input.jsx
@@ -105,7 +105,16 @@
                             data-test-id={this.props['data-test-id']}
                         />
                     )}
-
+                    {type === 'file' && (
+                        <FormControl
+                            bsClass={'form-control input-options-other'}
+                            onChange={e => this.onChangeFile(e)}
+                            disabled={isReadOnlyMode || Boolean(disabled)}
+                            type={type}
+                            data-test-id={this.props['data-test-id']}
+                            inputRef={input => (this.input = input)}
+                        />
+                    )}
                     {type === 'textarea' && (
                         <FormControl
                             className="form-control input-options-other"
@@ -220,6 +229,11 @@
         onChange(value);
     }
 
+    onChangeFile(e) {
+        let { onChange } = this.props;
+        onChange(e.target.files[0]);
+    }
+
     onChangeCheckBox(e) {
         let { onChange } = this.props;
         let checked = e.target.checked;
diff --git a/openecomp-ui/src/nfvo-utils/i18n/en.json b/openecomp-ui/src/nfvo-utils/i18n/en.json
index f57b7fd..5b2d09a 100644
--- a/openecomp-ui/src/nfvo-utils/i18n/en.json
+++ b/openecomp-ui/src/nfvo-utils/i18n/en.json
@@ -645,15 +645,18 @@
   "Certifications Query": "Certifications Query",
   "No Certifications Query are Available": "No Certifications Query are Available",
   "Selected Certifications Query": "Selected Certifications Query",
-  "Compliance Checks": "Compliance Checks",
-  "No Compliance Checks are Available": "No Compliance Checks are Available",
-  "Selected Compliance Tests": "Selected Compliance Tests",
+  "Available Tests": "Available Tests",
+  "No Tests are Available": "No Tests are Available",
+  "Selected Tests": "Selected Tests",
   "Value Should Be Minimum of {minLength} characters and a Maximum of {maxLength} characters": "Value Should Be Minimum of {minLength} characters and a Maximum of {maxLength} characters",
   "{title} Inputs :": "{title} Inputs :",
   "Scenario: {scenario} | Title: {title} | Test Case: {testCaseName} | Status: {status}": "Scenario: {scenario} | Title: {title} | Test Case: {testCaseName} | Status: {status}",
   "{title} results are not available": "{title} results are not available",
   "Test Results": "Test Results",
-  "No Validation Checks Performed": "No Validation Checks Performed",
-  "Unknown": "Unknown"
+  "No Test Performed": "No Test Performed",
+  "Unknown": "Unknown",
+  "No Test Result Available": "No Test Result Available",
+  "Test is In-progress": "Test is In-progress",
+  "has passed all checks": "has passed all checks"
 
 }
diff --git a/openecomp-ui/src/sdc-app/config/config.json b/openecomp-ui/src/sdc-app/config/config.json
index 784f19a..c2c7940 100644
--- a/openecomp-ui/src/sdc-app/config/config.json
+++ b/openecomp-ui/src/sdc-app/config/config.json
@@ -11,5 +11,6 @@
     "defaultDebugWebsocketPort": "9000",
     "defaultWebsocketPath": "notification-api/ws/notificationHandler",
     "defaultNotificationsWorkerUpdateMillisecond": 10000,
-    "showBrowseVNF": true
+    "showBrowseVNF": true,
+    "allTestScenario": "onap-dublin"
 }
diff --git a/openecomp-ui/src/sdc-app/onboarding/OnboardingActionHelper.js b/openecomp-ui/src/sdc-app/onboarding/OnboardingActionHelper.js
index 754c112..688806c 100644
--- a/openecomp-ui/src/sdc-app/onboarding/OnboardingActionHelper.js
+++ b/openecomp-ui/src/sdc-app/onboarding/OnboardingActionHelper.js
@@ -49,6 +49,8 @@
 import { notificationActions } from 'nfvo-components/notification/NotificationsConstants.js';
 import i18n from 'nfvo-utils/i18n/i18n.js';
 import SoftwareProductValidationActionHelper from './softwareProduct/validation/SoftwareProductValidationActionHelper.js';
+import SoftwareProductValidationResultsViewActionHelper from './softwareProduct/validationResults/SoftwareProductValidationResultsViewActionHelper.js';
+
 import { actionTypes as modalActionTypes } from 'nfvo-components/modal/GlobalModalConstants.js';
 
 function setCurrentScreen(dispatch, screen, props = {}) {
@@ -446,11 +448,26 @@
         dispatch,
         { softwareProductId, version, status }
     ) {
-        setCurrentScreen(
-            dispatch,
-            enums.SCREEN.SOFTWARE_PRODUCT_VALIDATION_RESULTS,
-            { softwareProductId, version, status }
-        );
+        SoftwareProductValidationResultsViewActionHelper.fetchVspChecks(
+            dispatch
+        )
+            .then(() => {
+                setCurrentScreen(
+                    dispatch,
+                    enums.SCREEN.SOFTWARE_PRODUCT_VALIDATION_RESULTS,
+                    { softwareProductId, version, status }
+                );
+            })
+            .catch(error => {
+                dispatch({
+                    type: modalActionTypes.GLOBAL_MODAL_ERROR,
+                    data: {
+                        title: 'ERROR',
+                        msg: error.responseJSON.message,
+                        cancelButtonText: i18n('OK')
+                    }
+                });
+            });
     },
 
     navigateToSoftwareProductDependencies(
diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductReducer.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductReducer.js
index 7b8c426..dcec5c6 100644
--- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductReducer.js
+++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductReducer.js
@@ -46,6 +46,7 @@
 import SoftwareProductComponentsComputeFlavorReducer from './components/compute/computeComponents/computeFlavor/ComputeFlavorReducer.js';
 import { createPlainDataReducer } from 'sdc-app/common/reducers/PlainDataReducer.js';
 import SoftwareProductDependenciesReducer from './dependencies/SoftwareProductDependenciesReducer.js';
+import SoftwareProductValidationResultsViewReducer from './validationResults/SoftwareProductValidationResultsViewReducer.js';
 import {
     createJSONSchemaReducer,
     createComposedJSONSchemaReducer
@@ -78,6 +79,9 @@
     softwareProductValidation: createPlainDataReducer(
         SoftwareProductValidationReducer
     ),
+    softwareProductValidationResult: createPlainDataReducer(
+        SoftwareProductValidationResultsViewReducer
+    ),
     softwareProductProcesses: combineReducers({
         processesList: SoftwareProductProcessesListReducer,
         processesEditor: createPlainDataReducer(
diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/validation/SoftwareProductValidation.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/validation/SoftwareProductValidation.js
index a6237e8..27d9b5e 100644
--- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/validation/SoftwareProductValidation.js
+++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/validation/SoftwareProductValidation.js
@@ -30,14 +30,21 @@
             SoftwareProductValidationActionHelper.onErrorThrown(dispatch, msg);
         },
 
-        onTestSubmit: (softwareProductId, version, status, tests) => {
+        onTestSubmit: (
+            softwareProductId,
+            version,
+            status,
+            tests,
+            requestId
+        ) => {
             SoftwareProductValidationActionHelper.navigateToSoftwareProductValidationResults(
                 dispatch,
                 {
                     softwareProductId,
                     version,
                     status,
-                    tests
+                    tests,
+                    requestId
                 }
             );
         },
diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/validation/SoftwareProductValidationActionHelper.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/validation/SoftwareProductValidationActionHelper.js
index 1ebb94b..fc6de3e 100644
--- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/validation/SoftwareProductValidationActionHelper.js
+++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/validation/SoftwareProductValidationActionHelper.js
@@ -15,18 +15,40 @@
  */
 import RestAPIUtil from 'nfvo-utils/RestAPIUtil.js';
 import Configuration from 'sdc-app/config/Configuration.js';
-import getValue from 'nfvo-utils/getValue.js';
 import { actionTypes } from './SoftwareProductValidationConstants.js';
 import ScreensHelper from 'sdc-app/common/helpers/ScreensHelper.js';
 import { enums, screenTypes } from 'sdc-app/onboarding/OnboardingConstants.js';
 import { actionTypes as modalActionTypes } from 'nfvo-components/modal/GlobalModalConstants.js';
 import i18n from 'nfvo-utils/i18n/i18n.js';
 
-function postVSPCertificationChecks(tests) {
+function createCertificationFormData(tests) {
+    var formData = new FormData();
+    var testData = [];
+    for (var test of tests) {
+        if (test.files) {
+            for (var file of test.files) {
+                formData.append('files', file.file, file.name);
+            }
+        }
+        delete test.files;
+        testData.push(test);
+    }
+    formData.append('testdata', JSON.stringify(testData));
+
+    return formData;
+}
+function postVSPCertificationChecks(
+    tests,
+    version,
+    softwareProductId,
+    requestId
+) {
     const restPrefix = Configuration.get('restPrefix');
+    var id = version.id;
+    var formData = createCertificationFormData(tests);
     return RestAPIUtil.post(
-        `${restPrefix}/v1.0/externaltesting/executions`,
-        getValue(tests)
+        `${restPrefix}/v1.0/externaltesting/executions?vspId=${softwareProductId}&vspVersionId=${id}&requestId=${requestId}`,
+        formData
     );
 }
 
@@ -35,41 +57,59 @@
     return RestAPIUtil.fetch(`${restPrefix}/v1.0/externaltesting/testcasetree`);
 }
 
+function extractEndPoint(tests) {
+    return [...new Set(tests.map(test => test.endpoint))];
+}
 const SoftwareProductValidationActionHelper = {
     navigateToSoftwareProductValidationResults(
         dispatch,
-        { softwareProductId, version, status, tests }
+        { softwareProductId, version, status, tests, requestId }
     ) {
-        postVSPCertificationChecks(tests)
-            .then(response => {
-                dispatch({
-                    type: actionTypes.POST_VSP_TESTS,
-                    vspTestResults: response
+        return new Promise((resolve, reject) => {
+            postVSPCertificationChecks(
+                tests,
+                version,
+                softwareProductId,
+                requestId
+            )
+                .then(response => {
+                    var testResultKeys = {};
+                    testResultKeys.endPoints = extractEndPoint(tests);
+                    testResultKeys.requestId = requestId;
+                    dispatch({
+                        type: actionTypes.POST_VSP_TESTS,
+                        vspTestResults: response,
+                        testResultKeys: testResultKeys
+                    });
+                    ScreensHelper.loadScreen(dispatch, {
+                        screen:
+                            enums.SCREEN.SOFTWARE_PRODUCT_VALIDATION_RESULTS,
+                        screenType: screenTypes.SOFTWARE_PRODUCT,
+                        props: {
+                            softwareProductId,
+                            version,
+                            status
+                        }
+                    });
+                    resolve(response);
+                })
+                .catch(error => {
+                    let errMessage =
+                        error.message || error.responseJSON.message;
+                    let title = error.responseJSON
+                        ? error.responseJSON.status
+                        : i18n('Error');
+                    dispatch({
+                        type: modalActionTypes.GLOBAL_MODAL_ERROR,
+                        data: {
+                            title: title,
+                            msg: errMessage,
+                            cancelButtonText: i18n('OK')
+                        }
+                    });
+                    reject(error);
                 });
-                ScreensHelper.loadScreen(dispatch, {
-                    screen: enums.SCREEN.SOFTWARE_PRODUCT_VALIDATION_RESULTS,
-                    screenType: screenTypes.SOFTWARE_PRODUCT,
-                    props: {
-                        softwareProductId,
-                        version,
-                        status
-                    }
-                });
-            })
-            .catch(error => {
-                let errMessage = error.message || error.responseJSON.message;
-                let title = error.responseJSON
-                    ? error.responseJSON.status
-                    : i18n('Error');
-                dispatch({
-                    type: modalActionTypes.GLOBAL_MODAL_ERROR,
-                    data: {
-                        title: title,
-                        msg: errMessage,
-                        cancelButtonText: i18n('OK')
-                    }
-                });
-            });
+        });
     },
 
     fetchVspChecks(dispatch) {
diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/validation/SoftwareProductValidationReducer.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/validation/SoftwareProductValidationReducer.js
index 4513e23..4a7f257 100644
--- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/validation/SoftwareProductValidationReducer.js
+++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/validation/SoftwareProductValidationReducer.js
@@ -20,7 +20,8 @@
         case actionTypes.POST_VSP_TESTS:
             return {
                 ...state,
-                vspTestResults: action.vspTestResults
+                vspTestResults: action.vspTestResults,
+                testResultKeys: action.testResultKeys
             };
         case actionTypes.FETCH_VSP_CHECKS:
             return {
diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/validation/SoftwareProductValidationView.jsx b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/validation/SoftwareProductValidationView.jsx
index fac6961..36cc7c7 100644
--- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/validation/SoftwareProductValidationView.jsx
+++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/validation/SoftwareProductValidationView.jsx
@@ -15,7 +15,7 @@
  */
 import React, { Component } from 'react';
 import PropTypes from 'prop-types';
-
+import Configuration from 'sdc-app/config/Configuration.js';
 import i18n from 'nfvo-utils/i18n/i18n.js';
 import { Button } from 'onap-ui-react';
 import { Tab, Tabs } from 'onap-ui-react';
@@ -74,7 +74,9 @@
     buildChildElements(setItem, testScenario) {
         let parentElement = {};
         parentElement.value = setItem.name;
-        parentElement.label = setItem.description;
+        parentElement.label = setItem.description
+            ? setItem.description
+            : setItem.name;
         parentElement.children = [];
         if (setItem.children !== undefined) {
             setItem.children.forEach(element => {
@@ -89,11 +91,13 @@
         }
         if (setItem.tests !== undefined) {
             setItem.tests.forEach(element => {
-                parentElement.children.push({
-                    value: element.testCaseName,
-                    label: element.description
-                });
-                this.setMapAndGeneralData(element, testScenario);
+                if (element.inputs) {
+                    parentElement.children.push({
+                        value: element.testCaseName,
+                        label: element.testCaseName
+                    });
+                    this.setMapAndGeneralData(element, testScenario);
+                }
             });
         }
         return parentElement;
@@ -115,6 +119,8 @@
                 parentNode.children.push({
                     value: element.testCaseName,
                     label: element.description
+                        ? element.description
+                        : element.testCaseName
                 });
                 this.setMapAndGeneralData(element, scenario);
             });
@@ -129,10 +135,11 @@
         let certificationList = [];
         let { setVspTestsMap } = this.props;
         if (Object.keys(res).length !== 0 && res.children) {
+            let allTestScenario = Configuration.get('allTestScenario');
             res.children.forEach(element => {
                 if (element.name === 'certification') {
                     certificationData = element;
-                } else if (element.name === 'compliance') {
+                } else if (element.name === allTestScenario) {
                     complianceData = element;
                 }
             });
diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/validation/inputs/VspValidationInputsView.jsx b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/validation/inputs/VspValidationInputsView.jsx
index 8888c92..cda3fe2 100644
--- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/validation/inputs/VspValidationInputsView.jsx
+++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/validation/inputs/VspValidationInputsView.jsx
@@ -15,7 +15,7 @@
  */
 import React, { Component } from 'react';
 import PropTypes from 'prop-types';
-
+import UUID from 'uuid-js';
 import i18n from 'nfvo-utils/i18n/i18n.js';
 import { Button } from 'onap-ui-react';
 import GridSection from 'nfvo-components/grid/GridSection.jsx';
@@ -35,23 +35,51 @@
 
     changeInputs(e, check, parameterName) {
         let { testsRequest, generalInfo, setTestsRequest } = this.props;
-        testsRequest[check].parameters[parameterName] = e;
+        if (e instanceof File) {
+            var timestamp = new Date().getTime();
+            var fileExtension = (
+                e.name.match(/[^\\\/]\.([^.\\\/]+)$/) || [null]
+            ).pop();
+            var fileName = fileExtension
+                ? timestamp + '.' + fileExtension
+                : timestamp;
+            testsRequest[check].parameters[parameterName] =
+                'file://' + fileName;
+
+            testsRequest[check].files = testsRequest[check].files
+                ? testsRequest[check].files
+                : [];
+            testsRequest[check].files.push({ file: e, name: fileName });
+        } else {
+            testsRequest[check].parameters[parameterName] = e;
+        }
+
         generalInfo[check][parameterName] = { isValid: true, errorText: '' };
         setTestsRequest(testsRequest, generalInfo);
     }
 
-    renderInputs(check) {
+    renderInputs(check, indexKey) {
         let { vspTestsMap, testsRequest, generalInfo } = this.props;
         return (
-            <div className="div-clear-both">
+            <div key={indexKey} className="div-clear-both">
                 <GridSection
                     title={i18n('{title} Inputs :', {
-                        title: vspTestsMap[check].title
+                        title: vspTestsMap[check].title.split(/\r?\n/)[0]
                     })}>
                     {vspTestsMap[check].parameters.map((parameter, index) => {
+                        parameter.metadata = parameter.metadata
+                            ? parameter.metadata
+                            : {};
                         if (
-                            parameter.type === 'text' &&
-                            !parameter.metadata.hidden
+                            !this.props.filterField(parameter) ||
+                            parameter.metadata.hidden
+                        ) {
+                            return;
+                        }
+                        if (
+                            parameter.type === 'text' ||
+                            parameter.type === 'string' ||
+                            parameter.type === 'json'
                         ) {
                             return (
                                 <GridItem key={index}>
@@ -112,6 +140,31 @@
                                     </Input>
                                 </GridItem>
                             );
+                        } else if (parameter.type === 'binary') {
+                            return (
+                                <GridItem key={index}>
+                                    <Input
+                                        label={parameter.description}
+                                        type="file"
+                                        isRequired={!parameter.isOptional}
+                                        isValid={
+                                            generalInfo[check][parameter.name]
+                                                .isValid
+                                        }
+                                        errorText={
+                                            generalInfo[check][parameter.name]
+                                                .errorText
+                                        }
+                                        onChange={e => {
+                                            this.changeInputs(
+                                                e.target ? e.target.value : e,
+                                                check,
+                                                parameter.name
+                                            );
+                                        }}
+                                    />
+                                </GridItem>
+                            );
                         }
                     })}
                 </GridSection>
@@ -127,18 +180,18 @@
         } = this.props;
         return (
             <div>
-                {complianceChecked.map(complianceCheck => {
+                {complianceChecked.map((complianceCheck, index) => {
                     if (vspTestsMap[complianceCheck].parameters.length === 0) {
                         return <div />;
                     } else {
-                        return this.renderInputs(complianceCheck);
+                        return this.renderInputs(complianceCheck, index);
                     }
                 })}
-                {certificationChecked.map(certificateCheck => {
+                {certificationChecked.map((certificateCheck, index) => {
                     if (vspTestsMap[certificateCheck].parameters.length === 0) {
                         return <div />;
                     } else {
-                        return this.renderInputs(certificateCheck);
+                        return this.renderInputs(certificateCheck, index);
                     }
                 })}
             </div>
@@ -159,7 +212,19 @@
     shouldComponentUpdate() {
         return true;
     }
-
+    filterField(parameter) {
+        if (
+            parameter.name === 'host-username' ||
+            parameter.name === 'vsp' ||
+            parameter.name === 'vsp-zip' ||
+            parameter.name === 'host-password' ||
+            parameter.name === 'host-url'
+        ) {
+            return false;
+        } else {
+            return true;
+        }
+    }
     validateInputs() {
         let areInputsValid = true;
         let { softwareProductValidation, setGeneralInfo } = this.props;
@@ -178,43 +243,57 @@
                     );
                     let isParameterValid = true;
                     let errorText = '';
-                    if (
-                        parameter.type === 'text' &&
-                        parameter.metadata.choices
-                    ) {
+                    if (!this.filterField(parameter)) {
+                        // Not required any action
+                    } else {
                         if (
-                            !parameter.isOptional &&
-                            !requestParameters[parameterName]
+                            (parameter.type === 'text' ||
+                                parameter.type === 'string') &&
+                            parameter.metadata.choices
                         ) {
-                            isParameterValid = false;
-                            errorText = i18n('Field is required');
-                        }
-                    } else if (parameter.type === 'text') {
-                        if (
-                            !parameter.isOptional &&
-                            !requestParameters[parameterName]
-                        ) {
-                            isParameterValid = false;
-                            errorText = i18n('Field is required');
+                            if (
+                                !parameter.isOptional &&
+                                !requestParameters[parameterName]
+                            ) {
+                                isParameterValid = false;
+                                errorText = i18n('Field is required');
+                            }
                         } else if (
-                            (!parameter.isOptional &&
-                                !requestParameters[parameterName]) ||
-                            (parameter.metadata.maxLength &&
-                                requestParameters[parameterName].length >
-                                    parseInt(parameter.metadata.maxLength)) ||
-                            (parameter.metadata.minLength &&
-                                requestParameters[parameterName].length <
-                                    parseInt(parameter.metadata.minLength) &&
-                                requestParameters[parameterName].length > 0)
+                            parameter.type === 'text' ||
+                            parameter.type === 'string' ||
+                            parameter.type === 'json' ||
+                            parameter.type === 'binary'
                         ) {
-                            isParameterValid = false;
-                            errorText = i18n(
-                                'Value Should Be Minimum of {minLength} characters and a Maximum of {maxLength} characters',
-                                {
-                                    minLength: parameter.metadata.minLength,
-                                    maxLength: parameter.metadata.maxLength
-                                }
-                            );
+                            if (
+                                !parameter.isOptional &&
+                                !requestParameters[parameterName]
+                            ) {
+                                isParameterValid = false;
+                                errorText = i18n('Field is required');
+                            } else if (
+                                (!parameter.isOptional &&
+                                    !requestParameters[parameterName]) ||
+                                (parameter.metadata.maxLength &&
+                                    requestParameters[parameterName].length >
+                                        parseInt(
+                                            parameter.metadata.maxLength
+                                        )) ||
+                                (parameter.metadata.minLength &&
+                                    requestParameters[parameterName].length <
+                                        parseInt(
+                                            parameter.metadata.minLength
+                                        ) &&
+                                    requestParameters[parameterName].length > 0)
+                            ) {
+                                isParameterValid = false;
+                                errorText = i18n(
+                                    'Value Should Be Minimum of {minLength} characters and a Maximum of {maxLength} characters',
+                                    {
+                                        minLength: parameter.metadata.minLength,
+                                        maxLength: parameter.metadata.maxLength
+                                    }
+                                );
+                            }
                         }
                     }
                     generalInfo[testCaseName][
@@ -244,13 +323,22 @@
         } = this.props;
 
         Object.keys(softwareProductValidation.testsRequest).forEach(key => {
-            tests.push(softwareProductValidation.testsRequest[key]);
+            var testReq = softwareProductValidation.testsRequest[key];
+            this.removeParameterFromTest(testReq);
+            tests.push(testReq);
         });
         if (this.validateInputs()) {
-            onTestSubmit(softwareProductId, version, status, tests);
+            var requestId = UUID.create()
+                .toString()
+                .split('-')[0];
+            onTestSubmit(softwareProductId, version, status, tests, requestId);
         }
     }
-
+    removeParameterFromTest(testReq) {
+        delete testReq.parameters['host-username'];
+        delete testReq.parameters['host-password'];
+        delete testReq.parameters['host-url'];
+    }
     prepareDataForVspInputs() {
         let { setTestsRequest } = this.props;
         let {
@@ -279,7 +367,10 @@
                     isValid={true}
                     onSubmit={() => this.performVSPTests()}
                     isReadOnlyMode={false}>
-                    <VspInputs {...this.prepareDataForVspInputs()} />
+                    <VspInputs
+                        {...this.prepareDataForVspInputs()}
+                        filterField={this.filterField}
+                    />
                     <Button
                         size="default"
                         data-test-id="proceed-to-validation-results-btn"
diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/validation/setup/VspValidationSetupView.jsx b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/validation/setup/VspValidationSetupView.jsx
index 012d50a..d1952bf 100644
--- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/validation/setup/VspValidationSetupView.jsx
+++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/validation/setup/VspValidationSetupView.jsx
@@ -206,10 +206,14 @@
         let { complianceNodes, setComplianceChecked } = this.props;
         return (
             <div className="validation-setup-checkbox-tree-section">
-                <GridSection title={i18n('Compliance Checks')}>
+                <GridSection title={i18n('Available Tests')}>
                     <GridItem colSpan={2}>
                         <div className="validation-view-title">
-                            {complianceNodes[0] ? complianceNodes[0].value : ''}
+                            {complianceNodes[0] && complianceNodes[0].value ? (
+                                complianceNodes[0].value
+                            ) : (
+                                <br />
+                            )}
                         </div>
                         <div
                             className="validation-setup-available-tests-section"
@@ -237,9 +241,7 @@
                                 />
                             )}
                             {complianceNodes.length === 0 && (
-                                <div>
-                                    {i18n('No Compliance Checks are Available')}
-                                </div>
+                                <div>{i18n('No Tests are Available')}</div>
                             )}
                         </div>
                     </GridItem>
@@ -247,7 +249,7 @@
                         {complianceNodes.length > 0 && (
                             <div>
                                 <div className="validation-view-title">
-                                    {i18n('Selected Compliance Tests')}
+                                    {i18n('Selected Tests')}
                                 </div>
                                 <div>
                                     <select
diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/validationResults/SoftwareProductValidationResults.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/validationResults/SoftwareProductValidationResults.js
index dffade7..ed88ddd 100644
--- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/validationResults/SoftwareProductValidationResults.js
+++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/validationResults/SoftwareProductValidationResults.js
@@ -15,14 +15,32 @@
  */
 import { connect } from 'react-redux';
 import SoftwareProductValidationResultsView from './SoftwareProductValidationResultsView.jsx';
+import SoftwareProductValidationResultsViewActionHelper from './SoftwareProductValidationResultsViewActionHelper.js';
 
 export const mapStateToProps = ({ softwareProduct }) => {
+    let { softwareProductValidationResult } = softwareProduct;
     let { softwareProductValidation } = softwareProduct;
     return {
+        softwareProductValidationResult,
         softwareProductValidation
     };
 };
-
-export default connect(mapStateToProps, null, null, {
+export const mapActionsToProps = dispatch => {
+    return {
+        refreshValidationResults: (requestId, endPoints) => {
+            return SoftwareProductValidationResultsViewActionHelper.refreshValidationResults(
+                dispatch,
+                { requestId, endPoints }
+            );
+        },
+        updateDisplayTestResultData: testResultToDisplay => {
+            return SoftwareProductValidationResultsViewActionHelper.updateDisplayTestResultData(
+                dispatch,
+                { testResultToDisplay }
+            );
+        }
+    };
+};
+export default connect(mapStateToProps, mapActionsToProps, null, {
     withRef: true
 })(SoftwareProductValidationResultsView);
diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/validationResults/SoftwareProductValidationResultsView.jsx b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/validationResults/SoftwareProductValidationResultsView.jsx
index 2c2cccd..c5da4f6 100644
--- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/validationResults/SoftwareProductValidationResultsView.jsx
+++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/validationResults/SoftwareProductValidationResultsView.jsx
@@ -20,64 +20,48 @@
 import GridSection from 'nfvo-components/grid/GridSection.jsx';
 import GridItem from 'nfvo-components/grid/GridItem.jsx';
 import i18n from 'nfvo-utils/i18n/i18n.js';
-import unCamelCasedString from 'nfvo-utils/unCamelCaseString.js';
-
-const TestResultComponent = ({ tests }) => {
-    return (
-        <div>
-            {tests.map((test, index) => {
-                let name = 'errorCircle';
-                let color = 'warning';
-                if (
-                    test.testResult &&
-                    test.testResult.toLowerCase() === 'pass'
-                ) {
-                    color = 'positive';
-                    name = 'checkCircle';
-                } else if (
-                    test.testResult &&
-                    test.testResult.toLowerCase() === 'fail'
-                ) {
-                    name = 'exclamationTriangleFull';
-                }
-                return (
-                    <li type="none" key={index}>
-                        <SVGIcon
-                            color={color}
-                            name={name}
-                            labelPosition="right"
-                        />
-                        <span className="validation-results-test-result-label">
-                            {test.testName +
-                                ' | ' +
-                                test.testResult +
-                                ' | ' +
-                                test.notes}
-                        </span>
-                    </li>
-                );
-            })}
-        </div>
-    );
-};
 
 class SoftwareProductValidationResultsView extends React.Component {
     static propTypes = {
-        softwareProductValidation: PropTypes.object
+        softwareProductValidation: PropTypes.object,
+        refreshValidationResults: PropTypes.func
     };
 
     constructor(props) {
         super(props);
         this.state = {
             vspId: this.props.softwareProductId,
-            versionNumber: this.props.version.name
+            versionNumber: this.props.version.name,
+            refreshValidationResults: this.props.refreshValidationResults,
+            vspTestResults: this.props.vspTestResults,
+            flatTestsMap: {},
+            generalInfo: {}
         };
     }
+    componentDidMount() {
+        this.configBasicTestData();
+    }
+    componentDidUpdate() {
+        this.updateTestResultToDisplay();
+    }
+
+    prepareDataForCheckboxes(children, ftm) {
+        for (var val of children) {
+            if (val.children) {
+                this.prepareDataForCheckboxes(val.children, ftm);
+            } else if (val.tests) {
+                for (var test of val.tests) {
+                    ftm[test.testCaseName] = test.description;
+                }
+            }
+        }
+        return ftm;
+    }
 
     getTitle(result) {
-        let { vspTestsMap } = this.props.softwareProductValidation;
+        let { flatTestsMap: vspTestsMap } = this.state;
         let title = vspTestsMap[result.testCaseName]
-            ? vspTestsMap[result.testCaseName].title
+            ? vspTestsMap[result.testCaseName].split(/\r?\n/)[0]
             : i18n('Unknown');
         return i18n(
             'Scenario: {scenario} | Title: {title} | Test Case: {testCaseName} | Status: {status}',
@@ -90,19 +74,36 @@
         );
     }
 
-    renderJSON(result) {
+    renderJSON(result, indexKey) {
+        if (result.status === 'in-progress') {
+            return this.renderInprogress(i18n('Test is In-progress'), indexKey);
+        } else {
+            return (
+                <li key={indexKey} type="none">
+                    <textarea
+                        disabled={true}
+                        className="validation-results-test-result-json"
+                        value={JSON.stringify(result, null, 2)}
+                    />
+                </li>
+            );
+        }
+    }
+    renderInprogress(result, indexKey) {
         return (
-            <li type="none">
-                <textarea
-                    disabled={true}
-                    className="validation-results-test-result-json"
-                    value={JSON.stringify(result, null, 2)}
+            <li key={indexKey} type="none">
+                <SVGIcon
+                    color="warning"
+                    name="exclamationTriangleLine"
+                    labelPosition="right"
                 />
+                <span className="validation-results-test-result-label">
+                    {result}
+                </span>
             </li>
         );
     }
-
-    renderError(result) {
+    renderError(result, indexKey) {
         if (Array.isArray(result)) {
             return result.map((parameter, index) => {
                 return (
@@ -120,95 +121,60 @@
                     </li>
                 );
             });
-        } else {
+        } else if (
+            typeof result === 'string' ||
+            result.hasOwnProperty('code') ||
+            result.hasOwnProperty('advice') ||
+            result.hasOwnProperty('message') ||
+            result.hasOwnProperty('error')
+        ) {
+            result =
+                result instanceof Object && result.error instanceof Object
+                    ? result.error
+                    : result;
             return (
-                <li type="none">
+                <li key={indexKey} type="none">
                     <SVGIcon
                         color="negative"
                         name="errorCircle"
                         labelPosition="right"
                     />
                     <span className="validation-results-test-result-label">
-                        {(result.code || '') +
-                            ' | ' +
-                            (result.advice || result.message)}
+                        {typeof result === 'string'
+                            ? result
+                            : (result.code || '') +
+                              ' | ' +
+                              (result.advice || result.message || result.error)}
                     </span>
                 </li>
             );
-        }
-    }
-
-    renderResults(result) {
-        if (typeof result === 'string' || result instanceof String) {
+        } else {
             return (
-                <div>
-                    <SVGIcon
-                        color="warning"
-                        name="errorCircle"
-                        labelPosition="right"
-                    />
-                    <span className="validation-results-test-result-label">
-                        {result}
-                    </span>
-                </div>
+                <Accordion key={indexKey} defaultExpanded>
+                    {this.renderJSON(result)}
+                </Accordion>
             );
         }
-        return Object.keys(result).map((key, index) => {
-            let title = unCamelCasedString(key);
-            if (
-                typeof result[key] === 'string' ||
-                result[key] instanceof String
-            ) {
-                return (
-                    <Accordion
-                        defaultExpanded
-                        dataTestId={title}
-                        title={title}
-                        key={index}>
-                        {this.renderString(result[key])}
-                    </Accordion>
-                );
-            } else if (Array.isArray(result[key])) {
-                if (result[key].length > 0) {
-                    return (
-                        <Accordion
-                            defaultExpanded
-                            dataTestId={title}
-                            title={title}
-                            key={index}>
-                            <TestResultComponent tests={result[key]} />
-                        </Accordion>
-                    );
-                } else {
-                    return (
-                        <Accordion
-                            defaultExpanded
-                            dataTestId={title}
-                            title={title}
-                            key={index}>
-                            {i18n('{title} results are not available', {
-                                title: title
-                            })}
-                        </Accordion>
-                    );
-                }
-            } else {
-                return (
-                    <Accordion
-                        defaultExpanded
-                        dataTestId={title}
-                        title={title}
-                        key={index}>
-                        {this.renderJSON(result[key])}
-                    </Accordion>
-                );
-            }
-        });
     }
 
-    renderString(result) {
+    renderResults(result, indexKey) {
         return (
-            <li type="none">
+            <li key={indexKey} type="none">
+                <SVGIcon
+                    color="positive"
+                    name="checkCircle"
+                    labelPosition="right"
+                />
+                <span className="validation-results-test-result-label">
+                    {result}
+                </span>
+            </li>
+        );
+    }
+
+    renderString(result, indexKey) {
+        return (
+            <li key={indexKey} type="none">
                 <textarea
                     type="textarea"
                     disabled={true}
@@ -219,92 +185,191 @@
         );
     }
 
-    buildSubAccordions(result) {
+    buildSubAccordions(result, indexKey) {
         let results = result.results;
 
         if (!results) {
             return (
                 <Accordion
+                    key={indexKey}
                     defaultExpanded
                     dataTestId="vsp-test-no-results"
                     title={this.getTitle(result)}>
-                    {this.renderJSON(result)}
+                    {this.renderJSON(result, indexKey)}
                 </Accordion>
             );
         } else if (typeof results === 'string' || results instanceof String) {
             return (
                 <Accordion
+                    key={indexKey}
                     defaultExpanded
                     dataTestId="vsp-test-string-results"
                     title={this.getTitle(result)}>
-                    {this.renderString(results)}
+                    {this.renderString(results, indexKey)}
                 </Accordion>
             );
         } else {
             return (
                 <Accordion
+                    key={indexKey}
                     defaultExpanded
                     dataTestId="vsp-test-object-results"
                     title={this.getTitle(result)}>
                     {Object.keys(results).length === 0
                         ? this.renderString(
-                              i18n('{title} results are not available', {
-                                  title: 'Test'
-                              })
+                              i18n(
+                                  '{title} results are not available',
+                                  {
+                                      title: 'Test'
+                                  },
+                                  indexKey
+                              )
                           )
-                        : Object.keys(results).map(key => {
-                              if (key === 'errors' || key === 'error') {
-                                  return this.renderError(results[key]);
-                              } else if (key === 'testResults') {
-                                  return this.renderResults(results[key]);
-                              } else {
-                                  let title = unCamelCasedString(key);
-                                  if (results[key] instanceof Object) {
-                                      return (
-                                          <Accordion
-                                              defaultExpanded
-                                              dataTestId={title}
-                                              title={title}>
-                                              {this.renderJSON(results[key])}
-                                          </Accordion>
-                                      );
-                                  } else {
-                                      return (
-                                          <Accordion
-                                              defaultExpanded
-                                              dataTestId={title}
-                                              title={title}>
-                                              {this.renderString(results[key])}
-                                          </Accordion>
-                                      );
-                                  }
-                              }
-                          })}
+                        : Array.isArray(results)
+                          ? Object.keys(results).map((key, indexKey) => {
+                                if (Object.keys(results[key]).length === 0) {
+                                    return this.renderResults(
+                                        result.testCaseName +
+                                            ' ' +
+                                            i18n('has passed all checks'),
+                                        indexKey
+                                    );
+                                } else {
+                                    return this.renderError(
+                                        results[key],
+                                        indexKey
+                                    );
+                                }
+                            })
+                          : this.renderError(results, indexKey)}
                 </Accordion>
             );
         }
     }
-
+    refreshValidationResult(thisObj) {
+        let { refreshValidationResults } = thisObj.props;
+        var testResultKey = this.props.softwareProductValidationResult
+            .testResultKeys[this.state.vspId + this.state.versionNumber];
+        refreshValidationResults(
+            testResultKey.requestId,
+            testResultKey.endPoints
+        );
+        delete this.props.softwareProductValidation.vspTestResults;
+    }
+    configBasicTestData() {
+        let {
+            softwareProductValidationResult,
+            softwareProductValidation
+        } = this.props;
+        if (
+            softwareProductValidationResult.vspChecks !== undefined &&
+            softwareProductValidationResult.vspChecks.children !== undefined
+        ) {
+            var ftm = this.prepareDataForCheckboxes(
+                this.props.softwareProductValidationResult.vspChecks.children,
+                {}
+            );
+            this.setState({
+                flatTestsMap: ftm
+            });
+        }
+        if (softwareProductValidation.testResultKeys) {
+            if (!this.props.softwareProductValidationResult.testResultKeys) {
+                this.props.softwareProductValidationResult.testResultKeys = {};
+            }
+            this.props.softwareProductValidationResult.testResultKeys[
+                this.state.vspId + this.state.versionNumber
+            ] =
+                softwareProductValidation.testResultKeys;
+            delete this.props.softwareProductValidation.testResultKeys;
+        }
+    }
+    updateTestResultToDisplay() {
+        if (this.props.softwareProductValidation.vspTestResults) {
+            let { updateDisplayTestResultData } = this.props;
+            var testResultToDisplay = this.props.softwareProductValidationResult
+                .testResultToDisplay;
+            testResultToDisplay = testResultToDisplay
+                ? testResultToDisplay
+                : {};
+            testResultToDisplay[
+                this.state.vspId + this.state.versionNumber
+            ] = this.props.softwareProductValidation.vspTestResults;
+            updateDisplayTestResultData(testResultToDisplay);
+            delete this.props.softwareProductValidation.vspTestResults;
+        } else if (this.props.softwareProductValidationResult.vspTestResults) {
+            let { updateDisplayTestResultData } = this.props;
+            var testResultToDisplay = this.props.softwareProductValidationResult
+                .testResultToDisplay
+                ? this.props.softwareProductValidationResult.testResultToDisplay
+                : {};
+            testResultToDisplay[
+                this.state.vspId + this.state.versionNumber
+            ] = this.props.softwareProductValidationResult.vspTestResults;
+            updateDisplayTestResultData(testResultToDisplay);
+            delete this.props.softwareProductValidationResult.vspTestResults;
+        }
+    }
     render() {
-        let results = this.props.softwareProductValidation.vspTestResults || [];
-        if (results.length > 0) {
+        let testResultToDisplay = this.props.softwareProductValidationResult
+            .testResultToDisplay;
+        let results = testResultToDisplay
+            ? testResultToDisplay[this.state.vspId + this.state.versionNumber]
+            : null;
+        if (!results) {
             return (
-                <GridSection title={i18n('Validation Results')}>
-                    <GridItem colSpan={10}>
-                        <Accordion
-                            defaultExpanded
-                            dataTestId="vsp-validation-test-result"
-                            title={i18n('Test Results')}>
-                            {results.map(row => this.buildSubAccordions(row))}
-                        </Accordion>
-                    </GridItem>
+                <GridSection title={i18n('Test Results')}>
+                    <h4>{i18n('No Test Performed')}</h4>
                 </GridSection>
             );
+        } else if (results.length > 0) {
+            return (
+                <div>
+                    <div
+                        onClick={() => this.refreshValidationResult(this)}
+                        data-test-id="vsp-validation-refresh-btn"
+                        className={'vcp-validation-refresh-btn'}>
+                        <SVGIcon
+                            label="Refresh"
+                            labelPosition="left"
+                            color=""
+                            iconClassName="vcp-validation-refresh-icon"
+                            name="versionControllerSync"
+                        />
+                    </div>
+                    <GridSection title={i18n('Test Results')}>
+                        <GridItem colSpan={10}>
+                            <Accordion
+                                defaultExpanded
+                                dataTestId="vsp-validation-test-result"
+                                title={i18n('Test Results')}>
+                                {results.map((row, index) =>
+                                    this.buildSubAccordions(row, index)
+                                )}
+                            </Accordion>
+                        </GridItem>
+                    </GridSection>
+                </div>
+            );
         } else {
             return (
-                <GridSection title={i18n('Validation Results')}>
-                    <h4>{i18n('No Validation Checks Performed')}</h4>
-                </GridSection>
+                <div>
+                    <div
+                        onClick={() => this.refreshValidationResult(this)}
+                        data-test-id="vsp-validation-refresh-btn"
+                        className={'vcp-validation-refresh-btn'}>
+                        <SVGIcon
+                            label="Refresh"
+                            labelPosition="left"
+                            color=""
+                            iconClassName="vcp-validation-refresh-icon"
+                            name="versionControllerSync"
+                        />
+                    </div>
+                    <GridSection title={i18n('Test Results')}>
+                        <h4>{i18n('No Test Result Available')}</h4>
+                    </GridSection>
+                </div>
             );
         }
     }
diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/validationResults/SoftwareProductValidationResultsViewActionHelper.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/validationResults/SoftwareProductValidationResultsViewActionHelper.js
new file mode 100644
index 0000000..4da8b9b
--- /dev/null
+++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/validationResults/SoftwareProductValidationResultsViewActionHelper.js
@@ -0,0 +1,79 @@
+/**
+ * Copyright (c) 2019 Vodafone Group
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import RestAPIUtil from 'nfvo-utils/RestAPIUtil.js';
+import Configuration from 'sdc-app/config/Configuration.js';
+import { actionTypes } from './SoftwareProductValidationResultsViewConstants.js';
+
+function encodeResultQueryData(requestId, endPoints) {
+    const query = [];
+    query.push('requestId=' + requestId);
+    endPoints.forEach(endPoint => {
+        query.push('endPoint=' + encodeURIComponent(endPoint));
+    });
+
+    return query.join('&');
+}
+function fetchVspValidationResults(requestId, endPoints) {
+    const restPrefix = Configuration.get('restPrefix');
+    const requestQuery = encodeResultQueryData(requestId, endPoints);
+    return RestAPIUtil.fetch(
+        `${restPrefix}/v1.0/externaltesting/executions?${requestQuery}`
+    );
+}
+function fetchVspChecks() {
+    const restPrefix = Configuration.get('restPrefix');
+    return RestAPIUtil.fetch(`${restPrefix}/v1.0/externaltesting/testcasetree`);
+}
+const SoftwareProductValidationResultsViewActionHelper = {
+    refreshValidationResults(dispatch, { requestId, endPoints }) {
+        return new Promise((resolve, reject) => {
+            fetchVspValidationResults(requestId, endPoints)
+                .then(response => {
+                    dispatch({
+                        type: actionTypes.FETCH_VSP_RESULT,
+                        vspTestResults: response
+                    });
+                    resolve(response);
+                })
+                .catch(error => {
+                    reject(error);
+                });
+        });
+    },
+    fetchVspChecks(dispatch) {
+        return new Promise((resolve, reject) => {
+            fetchVspChecks()
+                .then(response => {
+                    dispatch({
+                        type: actionTypes.FETCH_VSP_CHECKS,
+                        vspChecks: response
+                    });
+                    resolve(response);
+                })
+                .catch(error => {
+                    reject(error);
+                });
+        });
+    },
+    updateDisplayTestResultData(dispatch, { testResultToDisplay }) {
+        dispatch({
+            type: actionTypes.UPDATE_DISPLAY_TEST_RESULT_DATA,
+            testResultToDisplay: testResultToDisplay
+        });
+    }
+};
+
+export default SoftwareProductValidationResultsViewActionHelper;
diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/validationResults/SoftwareProductValidationResultsViewConstants.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/validationResults/SoftwareProductValidationResultsViewConstants.js
new file mode 100644
index 0000000..22fcb12
--- /dev/null
+++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/validationResults/SoftwareProductValidationResultsViewConstants.js
@@ -0,0 +1,25 @@
+/**
+ * Copyright (c) 2019 Vodafone Group
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import keyMirror from 'nfvo-utils/KeyMirror.js';
+
+export const actionTypes = keyMirror(
+    {
+        FETCH_VSP_RESULT: null,
+        FETCH_VSP_CHECKS: null,
+        UPDATE_DISPLAY_TEST_RESULT_DATA: null
+    },
+    'SoftwareProductValidationResults'
+);
diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/validationResults/SoftwareProductValidationResultsViewReducer.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/validationResults/SoftwareProductValidationResultsViewReducer.js
new file mode 100644
index 0000000..99bf68f
--- /dev/null
+++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/validationResults/SoftwareProductValidationResultsViewReducer.js
@@ -0,0 +1,27 @@
+import { actionTypes } from './SoftwareProductValidationResultsViewConstants.js';
+
+export default (state = {}, action) => {
+    switch (action.type) {
+        case actionTypes.FETCH_VSP_RESULT: {
+            return {
+                ...state,
+                vspTestResults: action.vspTestResults
+            };
+        }
+        case actionTypes.FETCH_VSP_CHECKS: {
+            return {
+                ...state,
+                vspChecks: action.vspChecks
+            };
+        }
+        case actionTypes.UPDATE_DISPLAY_TEST_RESULT_DATA: {
+            return {
+                ...state,
+                vspTestResults: null,
+                testResultToDisplay: action.testResultToDisplay
+            };
+        }
+        default:
+            return state;
+    }
+};
