diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/DataTestIdEnum.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/DataTestIdEnum.java
index 662b239..3823611 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/DataTestIdEnum.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/DataTestIdEnum.java
@@ -1033,4 +1033,42 @@
 		}
 	}
 
+	public enum VspValidationPage {
+
+		VSP_VALIDATION_PAGE_NAVBAR("navbar-group-item-SOFTWARE_PRODUCT_VALIDATION"),
+		VSP_VALIDATION_PAGE_BREADCRUMBS("sub-menu-button-validation"),
+		VSP_VALIDATION_PAGE_PROCEED_TO_INPUTS_BUTTON("go-to-vsp-validation-inputs"),
+		VSP_VALIDATION_PAGE_PROCEED_TO_SETUP_BUTTON("go-to-vsp-validation-setup"),
+		VSP_VALIDATION_PAGE_INPUT("%s_%s_input"),
+		VSP_VALIDATION_PAGE_PROCEED_TO_RESULTS_BUTTON("proceed-to-validation-results-btn"),
+		VSP_VALIDATION_PAGE_COMPLIANCE_CHECKBOX_TREE("vsp-validation-compliance-checks-checkbox-tree"),
+		VSP_VALIDATION_PAGE_CERTIFICATION_CHECKBOX_TREE("vsp-validation-certifications-query-checkbox-tree");
+
+		private String value;
+
+		public String getValue() {
+			return value;
+		}
+
+		private VspValidationPage(String value) {
+			this.value = value;
+		}
+	}
+
+	public enum VspValidationResultsPage {
+
+		VSP_VALIDATION_RESULTS_PAGE_NAVBAR("navbar-group-item-SOFTWARE_PRODUCT_VALIDATION_RESULTS"),
+		VSP_VALIDATION_RESULTS_PAGE_BREADCRUMBS("sub-menu-button-validation results");
+
+		private String value;
+
+		public String getValue() {
+			return value;
+		}
+
+		private VspValidationResultsPage(String value) {
+			this.value = value;
+		}
+	}
+
 }
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardingFlowsUI.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardingFlowsUI.java
index 77b2a0a..419ca6e 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardingFlowsUI.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardingFlowsUI.java
@@ -107,7 +107,158 @@
         runOnboardToDistributionFlow(resourceReqDetails, serviceReqDetails, filePath, vnfFile);
     }
 
+    @Test(dataProviderClass = org.openecomp.sdc.ci.tests.dataProviders.OnbordingDataProviders.class, dataProvider = "Single_VNF")
+    public void onapOnboardVSPValidationsSanityFlow(String filePath, String vnfFile) throws Exception, Throwable {
+        setLog(vnfFile);
+        String vspName = createNewVSP(filePath, vnfFile);
+        if(OnboardingUiUtils.getVspValidationCongiguration()){
+            goToVspScreen(true, vspName);
 
+            //check links are available
+            checkVspValidationLinksVisibility();
+
+            VspValidationPage.navigateToVspValidationPageUsingNavbar();
+            assertTrue("Next Button is enabled, it should have been disabled", VspValidationPage.checkNextButtonDisabled());
+            VspValidationResultsPage.navigateToVspValidationResultsPageUsingNavbar();
+            GeneralUIUtils.ultimateWait();
+            assertNotNull(GeneralUIUtils.findByText("No Validation Checks Performed"));
+        }
+        else {
+            goToVspScreen(true, vspName);
+
+            //check links are not available
+            checkVspValidationLinksInvisibility();
+        }
+    }
+
+
+    @Test(dataProviderClass = org.openecomp.sdc.ci.tests.dataProviders.OnbordingDataProviders.class, dataProvider = "Single_VNF")
+    public void onapOnboardVSPValidationsConfigurationChangeCheck(String filePath, String vnfFile) throws Exception, Throwable {
+        setLog(vnfFile);
+        String vspName = createNewVSP(filePath, vnfFile);
+        if(OnboardingUiUtils.getVspValidationCongiguration()){
+            goToVspScreen(true, vspName);
+            //check links are available
+            checkVspValidationLinksVisibility();
+
+            //change config
+            changeVspValidationConfig(false, vspName, OnboardingUiUtils.getVspValidationCongiguration());
+
+            //check links are not available
+            checkVspValidationLinksInvisibility();
+        }
+        else {
+            goToVspScreen(true, vspName);
+            //check links are not available
+            checkVspValidationLinksInvisibility();
+
+            changeVspValidationConfig(false, vspName, OnboardingUiUtils.getVspValidationCongiguration());
+
+            //check links are available
+            checkVspValidationLinksVisibility();
+        }
+    }
+
+    @Test(dataProviderClass = org.openecomp.sdc.ci.tests.dataProviders.OnbordingDataProviders.class, dataProvider = "Single_VNF")
+    public void onapOnboardVSPCertificationQueryFlow(String filePath, String vnfFile) throws Exception, Throwable {
+        setLog(vnfFile);
+        String vspName = createNewVSP(filePath, vnfFile);
+        if(!OnboardingUiUtils.getVspValidationCongiguration()){
+            //change config to true to test the feature
+            changeVspValidationConfig(true, vspName, OnboardingUiUtils.getVspValidationCongiguration());
+        }
+        else {
+            goToVspScreen(true, vspName);
+        }
+        VspValidationPage.navigateToVspValidationPageUsingNavbar();
+        assertTrue("Next Button is enabled, it should have been disabled", VspValidationPage.checkNextButtonDisabled());
+
+        if(VspValidationPage.checkCertificationQueryExists()){
+            VspValidationPage.clickCertificationQueryAll();
+            GeneralUIUtils.ultimateWait();
+            assertTrue("Next Button is disabled, it should have been enabled", !VspValidationPage.checkNextButtonDisabled());
+            VspValidationPage.clickOnNextButton();
+            GeneralUIUtils.ultimateWait();
+            VspValidationPage.clickOnSubmitButton();
+            GeneralUIUtils.waitForLoader();
+            assertTrue("Results are not available", VspValidationResultsPage.checkResultsExist());
+        }
+        else {
+            assertNotNull(GeneralUIUtils.findByText("No Certifications Query are Available"));
+        }
+
+    }
+
+    @Test(dataProviderClass = org.openecomp.sdc.ci.tests.dataProviders.OnbordingDataProviders.class, dataProvider = "Single_VNF")
+    public void onapOnboardVSPComplianceCheckFlow(String filePath, String vnfFile) throws Exception, Throwable {
+        setLog(vnfFile);
+        String vspName = createNewVSP(filePath, vnfFile);
+        if(!OnboardingUiUtils.getVspValidationCongiguration()){
+            //change config to true to test the feature
+            changeVspValidationConfig(true, vspName, OnboardingUiUtils.getVspValidationCongiguration());
+        }
+        else {
+            goToVspScreen(true, vspName);
+        }
+
+        VspValidationPage.navigateToVspValidationPageUsingNavbar();
+        assertTrue("Next Button is enabled, it should have been enabled", VspValidationPage.checkNextButtonDisabled());
+        if(VspValidationPage.checkComplianceCheckExists()){
+            VspValidationPage.clickComplianceChecksAll();
+            GeneralUIUtils.ultimateWait();
+            assertTrue("Next Button is disabled, it should have been enabled", !VspValidationPage.checkNextButtonDisabled());
+            VspValidationPage.clickOnNextButton();
+            GeneralUIUtils.ultimateWait();
+            VspValidationPage.clickOnSubmitButton();
+            GeneralUIUtils.waitForLoader();
+            assertTrue("Results are not available", VspValidationResultsPage.checkResultsExist());
+        }
+        else {
+            assertNotNull(GeneralUIUtils.findByText("No Compliance Checks are Available"));
+        }
+
+    }
+
+    private void checkVspValidationLinksVisibility(){
+        //check links are available
+        assertTrue("Validation Link is not available", GeneralUIUtils.isElementVisibleByTestId(DataTestIdEnum.VspValidationPage.VSP_VALIDATION_PAGE_NAVBAR.getValue()));
+        assertTrue("Validation Results Link is not available", GeneralUIUtils.isElementVisibleByTestId(DataTestIdEnum.VspValidationResultsPage.VSP_VALIDATION_RESULTS_PAGE_NAVBAR.getValue()));
+    }
+
+    private void checkVspValidationLinksInvisibility(){
+        //check links not available
+        assertTrue("Validation Link is still available", GeneralUIUtils.isElementInvisibleByTestId(DataTestIdEnum.VspValidationPage.VSP_VALIDATION_PAGE_NAVBAR.getValue()));
+        assertTrue("Validation Results Link is still available", GeneralUIUtils.isElementInvisibleByTestId(DataTestIdEnum.VspValidationResultsPage.VSP_VALIDATION_RESULTS_PAGE_NAVBAR.getValue()));
+    }
+
+    private void changeVspValidationConfig(boolean isCurrentScreenCatalogPage, String vspName, boolean vspConfig) throws Exception{
+        //change config
+        OnboardingUiUtils.putVspValidationCongiguration(!vspConfig);
+        assertTrue(String.format("Failed to set Congiguration to %s", !vspConfig), OnboardingUiUtils.getVspValidationCongiguration() != vspConfig);
+
+        if(!isCurrentScreenCatalogPage){
+            GeneralUIUtils.refreshWebpage();
+            GeneralUIUtils.ultimateWait();
+        }
+
+        goToVspScreen(isCurrentScreenCatalogPage, vspName);
+
+        //revert the config
+        OnboardingUiUtils.putVspValidationCongiguration(vspConfig);
+        assertTrue(String.format("Failed to revert Congiguration to %s", vspConfig), OnboardingUiUtils.getVspValidationCongiguration() == vspConfig);
+    }
+
+    private void goToVspScreen(boolean isCurrentScreenCatalogPage, String vspName) throws Exception{
+        if(isCurrentScreenCatalogPage)
+            GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.MainMenuButtons.ONBOARD_BUTTON.getValue());
+        GeneralUIUtils.clickOnElementByText(vspName);
+        GeneralUIUtils.waitForLoader();
+    }
+
+    private String createNewVSP(String filePath, String vnfFile) throws Exception {
+        ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
+        return OnboardingUiUtils.createVSP(resourceReqDetails, vnfFile, filePath, getUser()).getName();
+    }
     public void runOnboardToDistributionFlow(ResourceReqDetails resourceReqDetails, ServiceReqDetails serviceMetadata, String filePath, String vnfFile) throws Exception {
         getExtendTest().log(Status.INFO, "Going to create resource with category: " + resourceReqDetails.getCategories().get(0).getName()
                 + " subCategory: " + resourceReqDetails.getCategories().get(0).getSubcategories().get(0).getName()
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/VspValidationPage.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/VspValidationPage.java
new file mode 100644
index 0000000..286ee46
--- /dev/null
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/VspValidationPage.java
@@ -0,0 +1,100 @@
+/**
+ * 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.
+ */
+
+package org.openecomp.sdc.ci.tests.pages;
+
+import com.aventstack.extentreports.Status;
+import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
+import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
+import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.*;
+import static org.testng.AssertJUnit.assertTrue;
+
+
+import java.util.List;
+
+public class VspValidationPage extends GeneralPageElements {
+
+    public VspValidationPage() { super(); }
+
+    public static void navigateToVspValidationPageUsingNavbar() throws Exception {
+        clickOnElementUsingTestId(DataTestIdEnum.VspValidationPage.VSP_VALIDATION_PAGE_NAVBAR);
+    }
+
+    public static void navigateToVspValidationPageUsingBreadcrumbs() throws Exception {
+        clickOnElementUsingTestId(DataTestIdEnum.VspValidationPage.VSP_VALIDATION_PAGE_BREADCRUMBS);
+    }
+
+    public static void clickOnNextButton() throws Exception {
+        clickOnElementUsingTestId(DataTestIdEnum.VspValidationPage.VSP_VALIDATION_PAGE_PROCEED_TO_INPUTS_BUTTON);
+    }
+
+    public static void clickOnBackButton() throws Exception {
+        clickOnElementUsingTestId(DataTestIdEnum.VspValidationPage.VSP_VALIDATION_PAGE_PROCEED_TO_SETUP_BUTTON);
+    }
+
+    public static void clickOnSubmitButton() throws Exception {
+        clickOnElementUsingTestId(DataTestIdEnum.VspValidationPage.VSP_VALIDATION_PAGE_PROCEED_TO_RESULTS_BUTTON);
+    }
+
+    public static boolean checkNextButtonDisabled() throws Exception {
+        return GeneralUIUtils.isElementDisabled(DataTestIdEnum.VspValidationPage.VSP_VALIDATION_PAGE_PROCEED_TO_INPUTS_BUTTON.getValue());
+    }
+
+    public static void clickCertificationQueryAll() throws Exception {
+        List<WebElement> checkboxes = GeneralUIUtils.findElementsByXpath("//div[@data-test-id='vsp-validation-certifications-query-checkbox-tree']//label//span[@class='rct-checkbox']");
+        if(checkboxes.size() > 0){
+            checkboxes.get(0).click();
+        }
+        else
+            assertTrue("Checkbox Not Found", checkboxes.size() > 0);
+    }
+
+    public static void clickComplianceChecksAll() throws Exception {
+        List<WebElement> checkboxes = GeneralUIUtils.findElementsByXpath("//div[@data-test-id='vsp-validation-compliance-checks-checkbox-tree']//label//span[@class='rct-checkbox']");
+        if(checkboxes.size() > 0)
+            checkboxes.get(checkboxes.size() - 1).click();
+        else
+            assertTrue("Checkbox Not Found", checkboxes.size() > 0);
+    }
+
+    public static boolean checkCertificationQueryExists() throws Exception {
+        WebElement parentDiv = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.VspValidationPage.VSP_VALIDATION_PAGE_CERTIFICATION_CHECKBOX_TREE.getValue());
+        List<WebElement> checkboxTreeDivs = getChildElements(parentDiv);
+        List<WebElement> orderedList = getChildElements(checkboxTreeDivs.get(0));
+        return (orderedList.size() > 0);
+    }
+
+    public static boolean checkComplianceCheckExists() throws Exception {
+        WebElement parentDiv = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.VspValidationPage.VSP_VALIDATION_PAGE_COMPLIANCE_CHECKBOX_TREE.getValue());
+        List<WebElement> checkboxTreeDivs = getChildElements(parentDiv);
+        List<WebElement> orderedList = getChildElements(checkboxTreeDivs.get(0));
+        return (orderedList.size() > 0);
+    }
+
+    public static void clickOnElementUsingTestId(DataTestIdEnum.VspValidationPage elementTestId) throws Exception {
+        SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on %s", elementTestId.name()));
+        GeneralUIUtils.getWebElementByTestID(elementTestId.getValue()).click();
+        GeneralUIUtils.ultimateWait();
+    }
+
+    public static List<WebElement> getChildElements(WebElement webElement) throws Exception {
+        return webElement.findElements(By.xpath(".//*"));
+    }
+
+
+}
\ No newline at end of file
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/VspValidationResultsPage.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/VspValidationResultsPage.java
new file mode 100644
index 0000000..e71afd9
--- /dev/null
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/VspValidationResultsPage.java
@@ -0,0 +1,50 @@
+/**
+ * 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.
+ */
+
+package org.openecomp.sdc.ci.tests.pages;
+
+import com.aventstack.extentreports.Status;
+import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
+import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
+import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
+import org.openqa.selenium.WebElement;
+import org.testng.AssertJUnit;
+
+import java.util.List;
+
+public class VspValidationResultsPage extends GeneralPageElements {
+
+    public VspValidationResultsPage() { super(); }
+
+    public static void navigateToVspValidationResultsPageUsingNavbar() throws Exception {
+        clickOnElementUsingTestId(DataTestIdEnum.VspValidationResultsPage.VSP_VALIDATION_RESULTS_PAGE_NAVBAR);
+    }
+
+    public static void navigateToVspValidationResultsPageUsingBreadcrumbs() throws Exception {
+        clickOnElementUsingTestId(DataTestIdEnum.VspValidationResultsPage.VSP_VALIDATION_RESULTS_PAGE_BREADCRUMBS);
+    }
+
+    public static boolean checkResultsExist() throws Exception {
+        List<WebElement> results = GeneralUIUtils.findElementsByXpath("//h4[contains(text(),'No Validation Checks Performed')]");
+        return results.size() == 0;
+    }
+
+    public static void clickOnElementUsingTestId(DataTestIdEnum.VspValidationResultsPage elementTestId) throws Exception {
+        SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on %s", elementTestId.name()));
+        GeneralUIUtils.getWebElementByTestID(elementTestId.getValue()).click();
+        GeneralUIUtils.ultimateWait();
+    }
+}
\ No newline at end of file
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/GeneralUIUtils.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/GeneralUIUtils.java
index 30e6823..eed2590 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/GeneralUIUtils.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/GeneralUIUtils.java
@@ -49,7 +49,7 @@
 
 public final class GeneralUIUtils {
 
-    private static final String DATA_TESTS_ID = "//*[@data-tests-id='";
+    private static final String DATA_TESTS_ID = "//*[@data-tests-id='%1$s' or @data-test-id='%1$s']";
     private static final String COLOR_YELLOW_BORDER_4PX_SOLID_YELLOW = "color: yellow; border: 4px solid yellow;";
 
     private static int timeOut = (int) (60 * 1.5);
@@ -105,11 +105,11 @@
 
     public static WebElement getWebElementByTestID(String dataTestId, int timeout) {
         WebDriverWait wait = new WebDriverWait(getDriver(), timeout);
-        return wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(DATA_TESTS_ID + dataTestId + "']")));
+        return wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(String.format(DATA_TESTS_ID,dataTestId))));
     }
 
     public static boolean isWebElementExistByTestId(String dataTestId) {
-        return getDriver().findElements(By.xpath(DATA_TESTS_ID + dataTestId + "']")).size() != 0;
+        return getDriver().findElements(By.xpath(String.format(DATA_TESTS_ID,dataTestId))).size() != 0;
     }
 
     public static boolean isWebElementExistByClass(String className) {
@@ -119,7 +119,7 @@
     public static WebElement getInputElement(String dataTestId) {
         try {
             ultimateWait();
-            return getDriver().findElement(By.xpath(DATA_TESTS_ID + dataTestId + "']"));
+            return getDriver().findElement(By.xpath(String.format(DATA_TESTS_ID,dataTestId)));
         } catch (Exception e) {
             return null;
         }
@@ -127,7 +127,7 @@
 
     public static List<WebElement> getInputElements(String dataTestId) {
         ultimateWait();
-        return getDriver().findElements(By.xpath(DATA_TESTS_ID + dataTestId + "']"));
+        return getDriver().findElements(By.xpath(String.format(DATA_TESTS_ID,dataTestId)));
 
     }
 
@@ -165,7 +165,7 @@
     public static List<WebElement> getWebElementsListByContainTestID(String dataTestId) {
         try {
             WebDriverWait wait = new WebDriverWait(getDriver(), 10);
-            return wait.until(ExpectedConditions.presenceOfAllElementsLocatedBy(By.xpath("//*[contains(@data-tests-id, '" + dataTestId + "')]")));
+            return wait.until(ExpectedConditions.presenceOfAllElementsLocatedBy(By.xpath(String.format("//*[contains(@data-tests-id, '%1$s') or contains(@data-test-id, '%1$s')]",dataTestId))));
         } catch (Exception e) {
             return new ArrayList<WebElement>();
         }
@@ -187,7 +187,7 @@
 
     public static List<WebElement> getWebElementsListByTestID(String dataTestId) {
         WebDriverWait wait = new WebDriverWait(getDriver(), timeOut);
-        return wait.until(ExpectedConditions.visibilityOfAllElementsLocatedBy(By.xpath(DATA_TESTS_ID + dataTestId + "']")));
+        return wait.until(ExpectedConditions.visibilityOfAllElementsLocatedBy(By.xpath(String.format(DATA_TESTS_ID,dataTestId))));
     }
 
     public static List<WebElement> getWebElementsListByClassName(String className) {
@@ -199,13 +199,13 @@
     public static Boolean isElementInvisibleByTestId(String dataTestId) {
         WebDriverWait wait = new WebDriverWait(getDriver(), timeOut);
         return wait.until(
-                ExpectedConditions.invisibilityOfElementLocated(By.xpath(DATA_TESTS_ID + dataTestId + "']")));
+                ExpectedConditions.invisibilityOfElementLocated(By.xpath(String.format(DATA_TESTS_ID,dataTestId))));
     }
 
     public static Boolean isElementVisibleByTestId(String dataTestId) {
         try {
             WebDriverWait wait = new WebDriverWait(getDriver(), timeOut);
-            return wait.until(ExpectedConditions.visibilityOfElementLocated((By.xpath(DATA_TESTS_ID + dataTestId + "']")))).isDisplayed();
+            return wait.until(ExpectedConditions.visibilityOfElementLocated((By.xpath(String.format(DATA_TESTS_ID,dataTestId))))).isDisplayed();
         } catch (Exception e) {
             return false;
         }
@@ -218,22 +218,22 @@
 
     public static void clickOnElementByTestIdWithoutWait(String dataTestId) {
         WebDriverWait wait = new WebDriverWait(getDriver(), timeOut);
-        wait.until(ExpectedConditions.elementToBeClickable(By.xpath(DATA_TESTS_ID + dataTestId + "']"))).click();
+        wait.until(ExpectedConditions.elementToBeClickable(By.xpath(String.format(DATA_TESTS_ID,dataTestId)))).click();
     }
 
     public static void clickOnElementByInputTestIdWithoutWait(String dataTestId) {
         WebDriverWait wait = new WebDriverWait(getDriver(), timeOut);
-        wait.until(ExpectedConditions.elementToBeClickable(By.xpath(DATA_TESTS_ID + dataTestId + "']//*"))).click();
+        wait.until(ExpectedConditions.elementToBeClickable(By.xpath(String.format(DATA_TESTS_ID, dataTestId) + "//*"))).click();
     }
 
     public static void clickOnElementByTestId(String dataTestId, int customTimeout) {
         WebDriverWait wait = new WebDriverWait(getDriver(), customTimeout);
-        wait.until(ExpectedConditions.elementToBeClickable(By.xpath(DATA_TESTS_ID + dataTestId + "']"))).click();
+        wait.until(ExpectedConditions.elementToBeClickable(By.xpath(String.format(DATA_TESTS_ID,dataTestId)))).click();
     }
 
     public static WebElement waitForElementVisibilityByTestId(String dataTestId) {
         WebDriverWait wait = new WebDriverWait(getDriver(), timeOut);
-        return wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(DATA_TESTS_ID + dataTestId + "']")));
+        return wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(String.format(DATA_TESTS_ID,dataTestId))));
     }
 
     public static Boolean waitForElementInVisibilityByTestId(String dataTestId) {
@@ -242,9 +242,9 @@
 
     public static Boolean waitForElementInVisibilityByTestId(String dataTestId, int timeOut) {
         WebDriverWait wait = new WebDriverWait(getDriver(), timeOut);
-        boolean displayed = getDriver().findElements(By.xpath(DATA_TESTS_ID + dataTestId + "']")).isEmpty();
+        boolean displayed = getDriver().findElements(By.xpath(String.format(DATA_TESTS_ID,dataTestId))).isEmpty();
         if (!displayed) {
-            Boolean until = wait.until(ExpectedConditions.invisibilityOfElementLocated(By.xpath(DATA_TESTS_ID + dataTestId + "'])")));
+            Boolean until = wait.until(ExpectedConditions.invisibilityOfElementLocated(By.xpath(String.format(DATA_TESTS_ID,dataTestId))));
             ultimateWait();
             return until;
         }
@@ -385,7 +385,7 @@
 
     public static WebElement getSelectedElementFromDropDown(String dataTestId) {
         GeneralUIUtils.ultimateWait();
-        return new Select(getDriver().findElement(By.xpath(DATA_TESTS_ID + dataTestId + "']"))).getFirstSelectedOption();
+        return new Select(getDriver().findElement(By.xpath(String.format(DATA_TESTS_ID,dataTestId)))).getFirstSelectedOption();
     }
 
     public static boolean checkElementsCountInTable(int expectedElementsCount, Supplier<List<WebElement>> func) {
@@ -492,7 +492,7 @@
 
     public static boolean isElementDisabled(WebElement element) {
         return HighlightMyElement(element).getAttribute("class").contains("view-mode") ||
-                element.getAttribute("class").contains("disabled");
+                element.getAttribute("class").contains("disabled") || element.getAttribute("disabled") != null;
     }
 
     public static boolean isElementDisabled(String dataTestId) {
@@ -613,7 +613,7 @@
 
     public static void selectByValueTextContained(String dataTestsId, String value) {
 
-        List<WebElement> options = GeneralUIUtils.getWebElementsListBy(By.xpath(String.format("//select[@data-tests-id='%s']//option[contains(@value,'%s')]", dataTestsId, value)));
+        List<WebElement> options = GeneralUIUtils.getWebElementsListBy(By.xpath(String.format("//select[@data-tests-id='%1$s' or @data-test-id='%1$s']//option[contains(@value,'%2$s')]", dataTestsId, value)));
 
         boolean matched = false;
         for (WebElement option : options) {
@@ -668,6 +668,12 @@
         getDriver().navigate().to(url);
     }
 
+    public static void refreshWebpage() throws Exception {
+        SetupCDTest.getExtendTest().log(Status.INFO, "Refreshing Webpage");
+        getDriver().navigate().refresh();
+        ultimateWait();
+    }
+
     public static Object getElementPositionOnCanvas(String elementName) {
         String scriptJS = "var cy = window.jQuery('.sdc-composition-graph-wrapper').cytoscape('get');\n" +
                 "var n = cy.nodes('[name=\"" + elementName + "\"]');\n" +
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/OnboardingUiUtils.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/OnboardingUiUtils.java
index 9ef9515..6a91ed7 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/OnboardingUiUtils.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/OnboardingUiUtils.java
@@ -35,6 +35,7 @@
 import org.openecomp.sdc.ci.tests.verificator.VfVerificator;
 import org.openqa.selenium.WebElement;
 import org.testng.Assert;
+import org.openecomp.sdc.ci.tests.utils.general.OnboardingUtils;
 
 import java.io.File;
 import java.util.LinkedList;
@@ -80,6 +81,14 @@
         }
     }
 
+    public static boolean getVspValidationCongiguration() throws Exception{
+        return Boolean.parseBoolean(OnboardingUtils.getVspValidationConfiguration());
+    }
+
+    public static boolean putVspValidationCongiguration(boolean value) throws Exception{
+        return Boolean.parseBoolean(OnboardingUtils.putVspValidationConfiguration(value));
+    }
+
     public static void doCheckOut() {
         String lifeCycleState = ResourceGeneralPage.getLifeCycleState();
         boolean needCheckout = lifeCycleState.equals(LifeCycleStateEnum.CHECKIN.getValue()) || lifeCycleState.equals(LifeCycleStateEnum.CERTIFIED.getValue());
@@ -130,6 +139,14 @@
         DeploymentArtifactPage.verifyArtifactsExistInTable(filePath, updatedVnfFile);
     }
 
+    public static VendorSoftwareProductObject createVSP(ResourceReqDetails resourceReqDetails, String vnfFile, String filepath, User user) throws Exception {
+        ExtentTestActions.log(Status.INFO, String.format("Going to onboard the VNF %s", vnfFile));
+        System.out.println(String.format("Going to onboard the VNF %s", vnfFile));
+
+        AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(user);
+        return VendorSoftwareProductRestUtils.createVSP(resourceReqDetails, vnfFile, filepath, user, amdocsLicenseMembers);
+    }
+
 
     public static VendorSoftwareProductObject onboardAndValidate(ResourceReqDetails resourceReqDetails, String filepath, String vnfFile, User user) throws Exception {
         ExtentTestActions.log(Status.INFO, String.format("Going to onboard the VNF %s", vnfFile));
diff --git a/ui-ci/src/main/resources/ci/testSuites/onapUiSanity.xml b/ui-ci/src/main/resources/ci/testSuites/onapUiSanity.xml
index de03d3d..3945088 100644
--- a/ui-ci/src/main/resources/ci/testSuites/onapUiSanity.xml
+++ b/ui-ci/src/main/resources/ci/testSuites/onapUiSanity.xml
@@ -23,6 +23,7 @@
         <class name="org.openecomp.sdc.ci.tests.execute.sanity.OnboardingFlowsUI">
             <methods>
                 <include name="onapOnboardVNFflow"/>
+                <include name="onapOnboardVSPValidationsSanityFlow"/>
             </methods>
         </class>
 
diff --git a/ui-ci/src/main/resources/ci/testSuites/vspValidationAllFlows.xml b/ui-ci/src/main/resources/ci/testSuites/vspValidationAllFlows.xml
new file mode 100644
index 0000000..fcbd41e
--- /dev/null
+++ b/ui-ci/src/main/resources/ci/testSuites/vspValidationAllFlows.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="uitests" configfailurepolicy="continue" parallel="methods" thread-count="1" data-provider-thread-count="1">
+
+    <parameter name="makeDistribution"  value="false"/>
+
+  <test name="vspValidationAllFlows">
+    <classes>
+
+        <class name="org.openecomp.sdc.ci.tests.execute.sanity.OnboardingFlowsUI">
+            <methods>
+                <include name="onapOnboardVSPValidationsSanityFlow"/>
+                <include name="onapOnboardVSPValidationsConfigurationChangeCheck" />
+                <include name="onapOnboardVSPCertificationQueryFlow"/>
+                <include name="onapOnboardVSPComplianceCheckFlow"/>
+            </methods>
+        </class>
+
+    </classes>
+  </test> <!-- uitests -->
+</suite> <!-- uisuite -->
\ No newline at end of file
