diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/AddComponentInstancesArtifactsInCsar.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/AddComponentInstancesArtifactsInCsar.java
index fd23fbe..7ea23c1 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/AddComponentInstancesArtifactsInCsar.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/AddComponentInstancesArtifactsInCsar.java
@@ -28,7 +28,7 @@
 import org.openecomp.sdc.be.model.ComponentInstance;
 import org.openecomp.sdc.be.model.Resource;
 import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.datatypes.AmdocsLicenseMembers;
+import org.openecomp.sdc.ci.tests.datatypes.VendorLicenseModel;
 import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
 import org.openecomp.sdc.ci.tests.datatypes.HeatMetaFirstLevelDefinition;
 import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
@@ -87,9 +87,10 @@
         String vnfFile = "FDNT.zip";
         String snmpFile = "Fault-alarms-ASDC-vprobes-vLB.zip";
 
-        AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(getUser());
+        VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
         ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();//getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
-        VendorSoftwareProductObject createVSP = VendorSoftwareProductRestUtils.createVSP(resourceReqDetails, vnfFile, filePath, getUser(), amdocsLicenseMembers);
+        VendorSoftwareProductObject createVSP = VendorSoftwareProductRestUtils.createVSP(resourceReqDetails, vnfFile, filePath, getUser(),
+            vendorLicenseModel);
         String vspName = createVSP.getName();
         resourceMetaData.setName(vspName);
         VendorSoftwareProductRestUtils.addVFCArtifacts(filePath, snmpFile, null, createVSP, getUser());
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/Inputs.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/Inputs.java
index 2f0cc30..aa92732 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/Inputs.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/Inputs.java
@@ -68,7 +68,7 @@
     @Test
     public void deletingAnInputThatWasDeclaredFromComplexProperty() throws Exception {
         ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
-        ServiceUIUtils.createService(serviceMetadata, getUser());
+        ServiceUIUtils.createService(serviceMetadata);
 
         DeploymentArtifactPage.getLeftMenu().moveToCompositionScreen();
         CanvasManager canvasManager = CanvasManager.getCanvasManager();
@@ -126,7 +126,7 @@
     @Test
     public void deleteInputsWhoComeFromCpVlProperties() throws Exception {
         ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
-        ServiceUIUtils.createService(serviceMetadata, getUser());
+        ServiceUIUtils.createService(serviceMetadata);
 
         DeploymentArtifactPage.getLeftMenu().moveToCompositionScreen();
         CanvasManager canvasManager = CanvasManager.getCanvasManager();
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/LocalGeneralUtilities.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/LocalGeneralUtilities.java
index 38a347e..f5ebac6 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/LocalGeneralUtilities.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/LocalGeneralUtilities.java
@@ -24,7 +24,7 @@
 import org.json.simple.JSONObject;
 import org.json.simple.JSONValue;
 import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.datatypes.AmdocsLicenseMembers;
+import org.openecomp.sdc.ci.tests.datatypes.VendorLicenseModel;
 import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
 import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
 import org.openecomp.sdc.ci.tests.datatypes.VendorSoftwareProductObject;
@@ -77,8 +77,9 @@
     }
 
     public static String simpleOnBoarding(ResourceReqDetails resourceReqDetails, String fileName, String filePath, User user) throws Exception {
-        AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(user);
-        VendorSoftwareProductObject createVendorSoftwareProduct = VendorSoftwareProductRestUtils.createVendorSoftwareProduct(resourceReqDetails, fileName, filePath, user, amdocsLicenseMembers);
+        VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(user);
+        VendorSoftwareProductObject createVendorSoftwareProduct = VendorSoftwareProductRestUtils.createVendorSoftwareProduct(resourceReqDetails, fileName, filePath, user,
+            vendorLicenseModel);
         String vspName = createVendorSoftwareProduct.getName();
         HomePage.showVspRepository();
         OnboardingUiUtils.importVSP(createVendorSoftwareProduct);
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/MIBsArtifactsOnResourceInstance.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/MIBsArtifactsOnResourceInstance.java
index 58d4899..59c18fe 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/MIBsArtifactsOnResourceInstance.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/MIBsArtifactsOnResourceInstance.java
@@ -230,7 +230,7 @@
 
         // 4. Create service.
         ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
-        ServiceUIUtils.createService(serviceMetadata, getUser());
+        ServiceUIUtils.createService(serviceMetadata);
 
         // 5. Click on composition.
         ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/RemoveRestrictionOfDeploymentArtifacts.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/RemoveRestrictionOfDeploymentArtifacts.java
index 7c913d9..1bde1c1 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/RemoveRestrictionOfDeploymentArtifacts.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/RemoveRestrictionOfDeploymentArtifacts.java
@@ -52,7 +52,7 @@
     @Test
     public void createServiceWithoutRIAndArtifacts() throws Exception {
         ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
-        ServiceUIUtils.createService(serviceMetadata, getUser());
+        ServiceUIUtils.createService(serviceMetadata);
         //TODO Andrey should click on certify button
         ResourceGeneralPage.clickSubmitForTestingButton(serviceMetadata.getName());
     }
@@ -63,7 +63,7 @@
     @Test
     public void createServiceWithVlAndWithoutArtfiacts() throws Exception {
         ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
-        ServiceUIUtils.createService(serviceMetadata, getUser());
+        ServiceUIUtils.createService(serviceMetadata);
 
         ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
         CanvasManager canvasManager = CanvasManager.getCanvasManager();
@@ -100,7 +100,7 @@
 		reloginWithNewRole(UserRoleEnum.DESIGNER);*/
 
         ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
-        ServiceUIUtils.createService(serviceMetadata, getUser());
+        ServiceUIUtils.createService(serviceMetadata);
         ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
         CanvasManager canvasManager = CanvasManager.getCanvasManager();
         CanvasElement resourceInstance = canvasManager.createElementOnCanvas(resourceMetaData.getName());
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/Service_Tests_UI.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/Service_Tests_UI.java
index 31df507..b8430c4 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/Service_Tests_UI.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/Service_Tests_UI.java
@@ -54,7 +54,7 @@
         ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
         VendorSoftwareProductObject vendorSoftwareProductObject = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, FileHandling.getVnfRepositoryPath(), vnfFile, getUser());
         ServiceReqDetails servicemetadata = ElementFactory.getDefaultService(getUser());
-        ServiceUIUtils.createService(servicemetadata, getUser());
+        ServiceUIUtils.createService(servicemetadata);
         GeneralUIUtils.moveToStep(StepsEnum.COMPOSITION);
         CanvasManager service_CanvasManager = CanvasManager.getCanvasManager();
         CompositionPage.searchForElement(vendorSoftwareProductObject.getName());
@@ -74,7 +74,7 @@
         ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
         VendorSoftwareProductObject vendorSoftwareProductObject = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, FileHandling.getVnfRepositoryPath(), vnfFile, getUser());
         ServiceReqDetails servicemetadata = ElementFactory.getDefaultService(getUser());
-        ServiceUIUtils.createService(servicemetadata, getUser());
+        ServiceUIUtils.createService(servicemetadata);
         GeneralUIUtils.moveToStep(StepsEnum.COMPOSITION);
         CanvasManager service_CanvasManager = CanvasManager.getCanvasManager();
         CompositionPage.searchForElement(vendorSoftwareProductObject.getName());
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/VfModule.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/VfModule.java
index 5286d22..d2c37c2 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/VfModule.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/VfModule.java
@@ -22,8 +22,8 @@
 
 import com.aventstack.extentreports.Status;
 import org.openecomp.sdc.be.model.Service;
-import org.openecomp.sdc.ci.tests.dataProviders.OnbordingDataProviders;
-import org.openecomp.sdc.ci.tests.datatypes.AmdocsLicenseMembers;
+import org.openecomp.sdc.ci.tests.data.providers.OnboardingDataProviders;
+import org.openecomp.sdc.ci.tests.datatypes.VendorLicenseModel;
 import org.openecomp.sdc.ci.tests.datatypes.CanvasElement;
 import org.openecomp.sdc.ci.tests.datatypes.CanvasManager;
 import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.ToscaArtifactsScreenEnum;
@@ -81,15 +81,16 @@
 //		String vnfFile = "LDSA.zip";
 //		String vnfFile = "FDNT.zip";
         List<String> fileNamesFromFolder = OnboardingUtils.getVnfNamesFileListExcludeToscaParserFailure();
-        List<String> newRandomFileNamesFromFolder = OnbordingDataProviders.getRandomElements(1, fileNamesFromFolder);
+        List<String> newRandomFileNamesFromFolder = OnboardingDataProviders.getRandomElements(1, fileNamesFromFolder);
         String filePath = org.openecomp.sdc.ci.tests.utils.general.FileHandling.getVnfRepositoryPath();
         String vnfFile = newRandomFileNamesFromFolder.get(0);
         getExtendTest().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(getUser());
+        VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
         ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
-        VendorSoftwareProductObject createVendorSoftwareProduct = VendorSoftwareProductRestUtils.createVendorSoftwareProduct(resourceReqDetails, vnfFile, filepath, getUser(), amdocsLicenseMembers);
+        VendorSoftwareProductObject createVendorSoftwareProduct = VendorSoftwareProductRestUtils.createVendorSoftwareProduct(resourceReqDetails, vnfFile, filepath, getUser(),
+            vendorLicenseModel);
         String vspName = createVendorSoftwareProduct.getName();
         //
         DownloadManager.downloadCsarByNameFromVSPRepository(vspName, createVendorSoftwareProduct.getVspId());
@@ -129,7 +130,7 @@
 
         // create service
         ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
-        ServiceUIUtils.createService(serviceMetadata, getUser());
+        ServiceUIUtils.createService(serviceMetadata);
 
         ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
         CompositionPage.searchForElement(vspName);
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/extendNode_TemplatePropertiesWithDefaultValues.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/extendNode_TemplatePropertiesWithDefaultValues.java
index 7c448d5..92ab4a7 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/extendNode_TemplatePropertiesWithDefaultValues.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/extendNode_TemplatePropertiesWithDefaultValues.java
@@ -74,7 +74,7 @@
 
         if (ComponentTypeEnum.SERVICE == componentTypeEnum) {
             ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
-            ServiceUIUtils.createService(serviceMetadata, getUser());
+            ServiceUIUtils.createService(serviceMetadata);
         } else {
             ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
             ResourceUIUtils.createVF(resourceMetaData, getUser());
@@ -157,7 +157,7 @@
 
         if (ComponentTypeEnum.SERVICE == componentTypeEnum) {
             ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
-            ServiceUIUtils.createService(serviceMetadata, getUser());
+            ServiceUIUtils.createService(serviceMetadata);
         } else {
             ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
             ResourceUIUtils.createVF(resourceMetaData, getUser());
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/CanvasManager.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/CanvasManager.java
index 985c842..0541ab9 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/CanvasManager.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/CanvasManager.java
@@ -385,7 +385,7 @@
     }
 
     private void addFirstReqOrCap() {
-        GeneralUIUtils.getWebElementsListByClassName(DataTestIdEnum.LinkMenuItems.LINK_ITEM_CAP_Or_REQ.getValue()).get(0).click();
+        GeneralUIUtils.getWebElementsListByClassName(DataTestIdEnum.LinkMenuItems.LINK_ITEM_CAP_OR_REQ.getValue()).get(0).click();
     }
 
     private void linkMenuClickOnNextButton() throws Exception {
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 f099bab..0d21657 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
@@ -21,12 +21,19 @@
 package org.openecomp.sdc.ci.tests.datatypes;
 
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.List;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import org.openecomp.sdc.ci.tests.pages.TopSearchComponent;
 
 public final class DataTestIdEnum {
+
     private DataTestIdEnum() {
     }
 
+    @AllArgsConstructor
+    @Getter
     public enum Dashboard {
         IMPORT_AREA("importButtonsArea"),
         ADD_AREA("AddButtonsArea"),
@@ -40,17 +47,11 @@
         BUTTON_ADD_PNF("createPNFButton"),
         BUTTON_ADD_CR("createCRButton");
 
-        private String value;
-
-        public String getValue() {
-            return value;
-        }
-
-        Dashboard(String value) {
-            this.value = value;
-        }
+        private final String value;
     }
 
+    @AllArgsConstructor
+    @Getter
     public enum LifeCyleChangeButtons {
         CREATE("create/save"),
         CHECK_IN("check_in"),
@@ -60,17 +61,12 @@
         CERTIFY("certify"),
         CHECKOUT("check_out");
 
-        private String value;
+        private final String value;
 
-        public String getValue() {
-            return value;
-        }
-
-        LifeCyleChangeButtons(String value) {
-            this.value = value;
-        }
     }
 
+    @AllArgsConstructor
+    @Getter
     public enum DistributionChangeButtons {
         APPROVE("approve"),
         REJECT("reject"),
@@ -79,17 +75,12 @@
         APPROVE_MESSAGE("checkindialog"),
         RE_DISTRIBUTE("redistribute");
 
-        private String value;
+        private final String value;
 
-        public String getValue() {
-            return value;
-        }
-
-        DistributionChangeButtons(String value) {
-            this.value = value;
-        }
     }
 
+    @AllArgsConstructor
+    @Getter
     public enum InformationalArtifactsPlaceholders {
         CLOUD_QUESTIONNAIRE("Cloud Questionnaire (completed)"),
         FEATURES("Features"),
@@ -99,17 +90,12 @@
         HEAT_TEMPLATE_FROM_VENDOR("HEAT Template from Vendor"),
         CAPACITY("Capacity");
 
-        private String value;
+        private final String value;
 
-        public String getValue() {
-            return value;
-        }
-
-        InformationalArtifactsPlaceholders(String value) {
-            this.value = value;
-        }
     }
 
+    @AllArgsConstructor
+    @Getter
     public enum ModalItems {
         BROWSE_BUTTON("browseButton"),
         ADD("Add"),
@@ -127,17 +113,12 @@
         UPGRADE_SERVICES_CLOSE("upgradeVspModal-button-close"),
         ACCEPT_TESTING_MESSAGE("checkindialog");
 
-        private String value;
+        private final String value;
 
-        public String getValue() {
-            return value;
-        }
-
-        ModalItems(String value) {
-            this.value = value;
-        }
     }
 
+    @AllArgsConstructor
+    @Getter
     public enum LeftPanelCanvasItems {
         BLOCK_STORAGE("BlockStorage"),
         CINDER_VOLUME("CinderVolume"),
@@ -151,39 +132,23 @@
         CONTRAIL_PORT("ContrailPort"),
         CONTRAIL_VIRTUAL_NETWORK("ContrailVirtualNetwork");
 
-        private String value;
+        private final String value;
 
-        public String getValue() {
-            return value;
-        }
-
-        LeftPanelCanvasItems(String value) {
-            this.value = value;
-        }
     }
 
+    @AllArgsConstructor
+    @Getter
     public enum LinkMenuItems {
-        // CANCEL_BUTTON("link-menu-button-cancel"),
-        // CONNECT_BUTTON("link-menu-button-connect"),
-        // LINK_ITEM_CAP("link-item-capabilities"),
-        // LINK_ITEM_REQ("link-item-requirements"),
-        // LINK_MENU("link-menu-open");
-        LINK_ITEM_CAP_Or_REQ("req-or-cap-item"),
-        // REQ_CAP_SELECT_DATA_TESTS_ID("SelectType");
+        LINK_ITEM_CAP_OR_REQ("req-or-cap-item"),
         REQ_CAP_SELECT_DATA_TESTS_ID("value-select");
 
-        private String value;
+        private final String value;
 
-        public String getValue() {
-            return value;
-        }
-
-        LinkMenuItems(String value) {
-            this.value = value;
-        }
     }
 
 
+    @AllArgsConstructor
+    @Getter
     public enum GeneralCanvasItems {
         CANVAS("canvas"),
         CANVAS_RIGHT_PANEL("w-sdc-designer-sidebar-head"),
@@ -191,17 +156,12 @@
         UPDATE_INSTANCE_NAME("e-sdc-small-icon-update"),
         INSTANCE_NAME_FIELD("instanceName");
 
-        private String value;
+        private final String value;
 
-        public String getValue() {
-            return value;
-        }
-
-        GeneralCanvasItems(String value) {
-            this.value = value;
-        }
     }
 
+    @AllArgsConstructor
+    @Getter
     public enum ResourceMetadataEnum {
         RESOURCE_NAME("name"),
         DESCRIPTION("description"),
@@ -213,17 +173,13 @@
         ICON(" iconBox"),
         TAGS_TABLE("i-sdc-tag-text"),
         SELECT_VSP("filename");
-        private String value;
 
-        public String getValue() {
-            return value;
-        }
+        private final String value;
 
-        ResourceMetadataEnum(String value) {
-            this.value = value;
-        }
     }
 
+    @AllArgsConstructor
+    @Getter
     public enum GeneralElementsEnum {
         CREATE_BUTTON("create/save"),
         CHECKIN_BUTTON("check_in"),
@@ -236,21 +192,15 @@
         OK("OK"),
         UPDATE_SERVICES_BUTTON("open-upgrade-vsp-popup"),
         UPLOAD_FILE_INPUT("browseButton"),
-        // RESTORE_BUTTON("restore"),
         RESTORE_BUTTON("restore-component-button"),
-        // ARCHIVE_BUTTON("archive");
         ARCHIVE_BUTTON("archive-component-button");
-        private String value;
 
-        public String getValue() {
-            return value;
-        }
+        private final String value;
 
-        GeneralElementsEnum(String value) {
-            this.value = value;
-        }
     }
 
+    @AllArgsConstructor
+    @Getter
     public enum ArtifactPageEnum {
         ADD_DEPLOYMENT_ARTIFACT("add-deployment-artifact-button"),
         ADD_INFORMATIONAL_ARTIFACT("add-information-artifact-button"),
@@ -273,19 +223,14 @@
         UPLOAD_HEAT_ENV_PARAMETERS("uplaodEnv_"),
         VERSION_ENV("artifactEnvVersion_"),
         ADD_OTHER_ARTIFACT_BUTTON("//button[@class='add-button ng-scope']");
-        private String value;
 
-        public String getValue() {
-            return value;
-        }
+        private final String value;
 
-        ArtifactPageEnum(String value) {
-            this.value = value;
-        }
     }
 
+    @AllArgsConstructor
+    @Getter
     public enum PropertiesPageEnum {
-
         ADD_NEW_PROPERTY("addGrey"),
         EDIT_PROPERTY("edit_"),
         DELETE_PROPERTY("delete_"),
@@ -299,19 +244,14 @@
         PROPERTY_ROW("propertyRow"),
         SAVE("Save"),
         POPUP_FORM("sdc-edit-property-container");
-        private String value;
 
-        public String getValue() {
-            return value;
-        }
+        private final String value;
 
-        PropertiesPageEnum(String value) {
-            this.value = value;
-        }
     }
 
+    @AllArgsConstructor
+    @Getter
     public enum PropertiesPopupEnum {
-
         PROPERTY_NAME("propertyName"),
         PROPERTY_VALUE("defaultvalue"),
         PROPERTY_BOOLEAN_VALUE("booleantype"),
@@ -325,39 +265,29 @@
         DONE("Done"),
         PROPERTY_RADIO_BUTTON_CONTAINER("propertyRadioButton_"),
         RADIO_BUTTON_CLASS("tlv-radio-label");
-        private String value;
 
-        public String getValue() {
-            return value;
-        }
+        private final String value;
 
-        PropertiesPopupEnum(String value) {
-            this.value = value;
-        }
     }
 
+    @AllArgsConstructor
+    @Getter
     public enum AdminPageTabs {
         USER_MANAGEMENT("usermanagmenttab"),
         CATEGORY_MANAGEMENT("categorymanagmenttab");
 
-        private String value;
+        private final String value;
 
-        public String getValue() {
-            return value;
-        }
-
-        AdminPageTabs(String value) {
-            this.value = value;
-        }
     }
 
+    @AllArgsConstructor
+    @Getter
     public enum UserManagementEnum {
-
         SEARCH_BOX("searchbox"),
         NEW_USER_FIELD("newuserId"),
         ROLE_SELECT("selectrole"),
         CREATE_BUTTON("creategreen"),
-        CLASS__USER_MANAGEMENT_TABLE("sdc-user-management-table"),
+        CLASS_USER_MANAGEMENT_TABLE("sdc-user-management-table"),
         ROW_TABLE("row_"),
         FIRST_NAME("firstName_"),
         LAST_NAME("lastName__"),
@@ -370,20 +300,13 @@
         SAVE_USER("save_"),
         DELETE_USER("delete_");
 
+        private final String value;
 
-        private String value;
-
-        public String getValue() {
-            return value;
-        }
-
-        UserManagementEnum(String value) {
-            this.value = value;
-        }
     }
 
+    @AllArgsConstructor
+    @Getter
     public enum CategoryManagement {
-
         SERVICE_CATEGORY_HEADER("servicecategoryheader"),
         RESOURCE_CATEGORY_HEADER("resourcecategoryheader"),
         SERVICE_CATEGORY_LIST("servicecategory"),
@@ -392,63 +315,46 @@
         NEW_SUB_CATEGORY_BUTTON("newsubcategory"),
         NEW_CATEGORY_NAME("i-sdc-form-input");
 
-        private String value;
+        private final String value;
 
-        public String getValue() {
-            return value;
-        }
-
-        CategoryManagement(String value) {
-            this.value = value;
-        }
     }
 
 
+    @AllArgsConstructor
+    @Getter
     public enum MainMenuButtons {
         HOME_BUTTON("main-menu-button-home"),
         CATALOG_BUTTON("main-menu-button-catalog"),
         ONBOARD_BUTTON("main-menu-button-onboard"),
-        SEARCH_BOX("main-menu-input-search"),
+        SEARCH_BOX(TopSearchComponent.SEARCH_INPUT_TEST_ID),
         REPOSITORY_ICON("repository-icon");
-        private String value;
 
-        public String getValue() {
-            return value;
-        }
+        private final String value;
 
-        MainMenuButtons(String value) {
-            this.value = value;
-        }
     }
 
+    @AllArgsConstructor
+    @Getter
     public enum CatalogSwitchButtons {
         CATALOG_SWITCH_BUTTON("catalog-selector-button"), // get possible catalog types(active/archive)
         CATALOG_ACTIVE_ITEMS("catalog-selector-0"), // select active catalog
         CATALOG_ARCHIVE("catalog-selector-1"); // select archive catalog
-        private String value;
 
-        public String getValue() {
-            return value;
-        }
+        private final String value;
 
-        CatalogSwitchButtons(String value) {
-            this.value = value;
-        }
     }
 
+    @AllArgsConstructor
+    @Getter
     public enum MainMenuButtonsFromInsideFrame {
         HOME_BUTTON("breadcrumbs-button-0");
-        private String value;
 
-        public String getValue() {
-            return value;
-        }
+        private final String value;
 
-        MainMenuButtonsFromInsideFrame(String value) {
-            this.value = value;
-        }
     }
 
+    @AllArgsConstructor
+    @Getter
     public enum MenuOptionsEnum {
         EDIT("Edit"),
         CHECK_IN("Check in"),
@@ -460,17 +366,12 @@
         START_TEST("Start test"),
         DISTREBUTE("Distribute");
 
-        private String value;
+        private final String value;
 
-        public String getValue() {
-            return value;
-        }
-
-        MenuOptionsEnum(String value) {
-            this.value = value;
-        }
     }
 
+    @AllArgsConstructor
+    @Getter
     public enum StepsEnum {
         GENERAL("GeneralLeftSideMenu"),
         ICON("Iconstep"),
@@ -487,17 +388,12 @@
         HIERARCHY("Hierarchy"),
         PROPERTIES_ASSIGNMENT("Properties AssignmentLeftSideMenu");
 
-        private String value;
+        private final String value;
 
-        public String getValue() {
-            return value;
-        }
-
-        StepsEnum(String value) {
-            this.value = value;
-        }
     }
 
+    @AllArgsConstructor
+    @Getter
     public enum ArtifactPopup {
 
         BROWSE("browseButton"),
@@ -511,17 +407,12 @@
         URL("input[class^='i-sdc-form-input']"),
         MODAL_WINDOW("sdc-add-artifact");
 
-        private String value;
+        private final String value;
 
-        public String getValue() {
-            return value;
-        }
-
-        ArtifactPopup(String value) {
-            this.value = value;
-        }
     }
 
+    @AllArgsConstructor
+    @Getter
     public enum ServiceMetadataEnum {
         SERVICE_NAME("name"),
         DESCRIPTION("description"),
@@ -532,17 +423,12 @@
         ICON(" iconBox"),
         INSTANTIATION_TYPE("selectInstantiationType");
 
-        private String value;
+        private final String value;
 
-        public String getValue() {
-            return value;
-        }
-
-        ServiceMetadataEnum(String value) {
-            this.value = value;
-        }
     }
 
+    @AllArgsConstructor
+    @Getter
     public enum ProductMetadataEnum {
         PRODUCT_NAME("name"),
         FULL_NAME("fullName"),
@@ -552,17 +438,12 @@
         ATT_CONTACT("attContact"),
         ICON(" iconBox");
 
-        private String value;
+        private final String value;
 
-        public String getValue() {
-            return value;
-        }
-
-        ProductMetadataEnum(String value) {
-            this.value = value;
-        }
     }
 
+    @AllArgsConstructor
+    @Getter
     public enum DashboardCardEnum {
         ASSET_TYPE("asset-type"), LIFECYCLE_STATE("span[class^='w-sdc-dashboard-card-info-lifecycleState']"),
         INFO_NAME("div.sdc-tile-info-line"),
@@ -571,17 +452,12 @@
         INFO_TITLE_XPATH("//div[contains(@class,'sdc-tile-info-line title')]"),
         ASSET_TYPE_CSS("span[data-tests-id='asset-type']");
 
-        private String value;
+        private final String value;
 
-        public String getValue() {
-            return value;
-        }
-
-        DashboardCardEnum(String value) {
-            this.value = value;
-        }
     }
 
+    @AllArgsConstructor
+    @Getter
     public enum CatalogPageLeftPanelCategoryCheckbox {
         GENERIC_CHECKBOX("span[data-tests-id='checkbox-resourcenewcategory.generic']"),
         NETWORK_L2_3("span[data-tests-id='checkbox-resourcenewcategory.networkl2-3']"),
@@ -590,39 +466,29 @@
         APPLICATION_L4_PLUS("span[data-tests-id='checkbox-resourcenewcategory.applicationl4+']"),
         DCAE("span[data-tests-id='checkbox-resourcenewcategory.dcaecomponent']");
 
-        private String value;
+        private final String value;
 
-        public String getValue() {
-            return value;
-        }
-
-        CatalogPageLeftPanelCategoryCheckbox(String value) {
-            this.value = value;
-        }
     }
 
+    @AllArgsConstructor
+    @Getter
     public enum CatalogPageLeftPanelFilterTitle {
         TYPE("span[data-tests-id='typeFilterTitle']"),
         CATEGORIES("span[data-tests-id='categoriesFilterTitle']"),
         STATUS("span[data-tests-id='statusFilterTitle']");
 
-        private String value;
+        private final String value;
 
-        public String getValue() {
-            return value;
-        }
-
-        CatalogPageLeftPanelFilterTitle(String value) {
-            this.value = value;
-        }
     }
 
+    @AllArgsConstructor
+    @Getter
     public enum CatalogPageLeftPanelSubCategoryCheckbox {
         COMMON_NETWORK_RESOURCES("span[data-tests-id='checkbox-resourcenewcategory.networkl4+.commonnetworkresources']"),
         ROUTER("span[data-tests-id='checkbox-resourcenewcategory.networkl2-3.router']"),
         WAN_CONNECTORS("span[data-tests-id='checkbox-resourcenewcategory.networkl2-3.wanconnectors']"),
         LAN_CONNECTORS("span[data-tests-id='checkbox-resourcenewcategory.networkl2-3.lanconnectors']"),
-        INFRASTRUCTERE_NETWORKl2_3("span[data-tests-id='checkbox-resourcenewcategory.networkl2-3.infrastructure']"),
+        INFRASTRUCTURE_NETWORK_L2_3("span[data-tests-id='checkbox-resourcenewcategory.networkl2-3.infrastructure']"),
         GATEWAY("span[data-tests-id='checkbox-resourcenewcategory.networkl2-3.gateway']"),
         NETWORK_ELEMENTS("span[data-tests-id='checkbox-resourcenewcategory.generic.networkelements']"),
         ABSTRACT("span[data-tests-id='checkbox-resourcenewcategory.generic.abstract']"),
@@ -647,58 +513,43 @@
         UTILITY("span[data-tests-id='checkbox-resourcenewcategory.dcaecomponent.utility']"),
         ANALYTICS("span[data-tests-id='checkbox-resourcenewcategory.dcaecomponent.analytics']");
 
-        private String value;
+        private final String value;
 
-        public String getValue() {
-            return value;
-        }
-
-        CatalogPageLeftPanelSubCategoryCheckbox(String value) {
-            this.value = value;
-        }
     }
 
+    @AllArgsConstructor
+    @Getter
     public enum CompositionScreenEnum {
-
-        CHANGE_VERSION("changeVersion", Arrays.asList()),
-        DEPLOYMENT_ARTIFACT_TAB("deployment-artifact-tab", Arrays.asList("Deployment Artifacts")),
-        ADD_ARTIFACT("add_Artifact_Button", Arrays.asList()),
-        SEARCH_ASSET("searchAsset", Arrays.asList()),
-        PROPERTIES_AND_ATTRIBUTES_TAB("properties-and-attributes-tab", Arrays.asList()),
-        MENU_INPUTS("sub-menu-button-inputs", Arrays.asList()),
-        MENU_ONBOARD("sub-menu-button-onboard", Arrays.asList()),
-        MENU_HOME("sub-menu-button-home", Arrays.asList()),
-        MENU_PROPERTIES_ASSIGNMENT("sub-menu-button-properties assignment", Arrays.asList()),
-        MENU_TRIANGLE_DROPDOWN("triangle-dropdown", Arrays.asList()),
-        ARTIFACTS_LIST("artifactName", Arrays.asList()),
-        INFORMATION_ARTIFACTS("button[tooltip-content='Information Artifacts']", Arrays.asList("Informational Artifacts")),
-        API("button[tooltip-content='API']", Arrays.asList("API Artifacts")),
+        CHANGE_VERSION("changeVersion", Collections.emptyList()),
+        DEPLOYMENT_ARTIFACT_TAB("deployment-artifact-tab", Collections.singletonList("Deployment Artifacts")),
+        ADD_ARTIFACT("add_Artifact_Button", Collections.emptyList()),
+        SEARCH_ASSET("searchAsset", Collections.emptyList()),
+        PROPERTIES_AND_ATTRIBUTES_TAB("properties-and-attributes-tab", Collections.emptyList()),
+        MENU_INPUTS("sub-menu-button-inputs", Collections.emptyList()),
+        MENU_ONBOARD("sub-menu-button-onboard", Collections.emptyList()),
+        MENU_HOME("sub-menu-button-home", Collections.emptyList()),
+        MENU_PROPERTIES_ASSIGNMENT("sub-menu-button-properties assignment", Collections.emptyList()),
+        MENU_TRIANGLE_DROPDOWN("triangle-dropdown", Collections.emptyList()),
+        ARTIFACTS_LIST("artifactName", Collections.emptyList()),
+        INFORMATION_ARTIFACTS("button[tooltip-content='Information Artifacts']",
+            Collections.singletonList("Informational Artifacts")),
+        API("button[tooltip-content='API']", Collections.singletonList("API Artifacts")),
         INFORMATION("button[tooltip-content='Information']", Arrays.asList("General Info", "Additional Information", "Tags")),
-        COMPOSITION("button[tooltip-content='Composition']", Arrays.asList("Composition")),
-        INPUTS("button[tooltip-content='Inputs']", Arrays.asList("")),
-        REQUIREMENTS_AND_CAPABILITIES("button[tooltip-content='Requirements and Capabilities']", Arrays.asList()),
-        INFORMATION_TAB("information-tab", Arrays.asList()),
-        CUSTOMIZATION_UUID("rightTab_customizationModuleUUID", Arrays.asList());
+        COMPOSITION("button[tooltip-content='Composition']", Collections.singletonList("Composition")),
+        INPUTS("button[tooltip-content='Inputs']", Collections.singletonList("")),
+        REQUIREMENTS_AND_CAPABILITIES("button[tooltip-content='Requirements and Capabilities']",
+            Collections.emptyList()),
+        INFORMATION_TAB("information-tab", Collections.emptyList()),
+        CUSTOMIZATION_UUID("rightTab_customizationModuleUUID", Collections.emptyList());
 
-        private String value;
-        private List<String> title;
+        private final String value;
+        private final List<String> title;
 
-        public String getValue() {
-            return value;
-        }
-
-        public List<String> getTitle() {
-            return title;
-        }
-
-        CompositionScreenEnum(String value, List<String> title) {
-            this.value = value;
-            this.title = title;
-        }
     }
 
+    @AllArgsConstructor
+    @Getter
     public enum ToscaArtifactsScreenEnum {
-
         TOSCA_MODEL("download-Tosca Model"),
         TOSCA_TEMPLATE("download-Tosca Template"),
         ARTIFACT_VERSION("version-"),
@@ -708,17 +559,12 @@
         DOWNLOAD_ARTIFACT("download-"),
         DOWNLOAD_CSAR("download-Tosca Model");
 
-        private String value;
+        private final String value;
 
-        public String getValue() {
-            return value;
-        }
-
-        ToscaArtifactsScreenEnum(String value) {
-            this.value = value;
-        }
     }
 
+    @AllArgsConstructor
+    @Getter
     public enum InformationalArtifactsService {
         AFFINITY_RULES("artifact_Display_Name-Affinity Rules"),
         CONTROL_LOOP_FUNCTIONS("artifact_Display_Name-Control Loop Functions"),
@@ -734,19 +580,13 @@
         SUMMARY_OF_IMPACTS_TO_ECOMP("artifact_Display_Name-Summary of impacts to ECOMP elements,OSSs, BSSs"),
         TD_CERTIFICATION_TEST_RESULTS("artifact_Display_Name-TD Certification Test Results");
 
-        private String value;
+        private final String value;
 
-        public String getValue() {
-            return value;
-        }
-
-        InformationalArtifactsService(String value) {
-            this.value = value;
-        }
     }
 
+    @AllArgsConstructor
+    @Getter
     public enum APIArtifactsService {
-
         CONFIGURATION("artifact_Display_Name-Configuration"),
         INSTANTIATION("artifact_Display_Name-Instantiation"),
         LOGGING("artifact_Display_Name-Logging"),
@@ -754,17 +594,12 @@
         REPORTING("artifact_Display_Name-Reporting"),
         TESTING("artifact_Display_Name-Testing");
 
-        private String value;
+        private final String value;
 
-        public String getValue() {
-            return value;
-        }
-
-        APIArtifactsService(String value) {
-            this.value = value;
-        }
     }
 
+    @AllArgsConstructor
+    @Getter
     public enum DeploymentArtifactCompositionRightMenu {
         ARTIFACT_NAME("artifactName-"),
         ARTIFACT_DISPLAY_NAME("artifact_Display_Name-"),
@@ -775,18 +610,12 @@
         ARTIFACT_ITEM("artifact-item-"),
         ARTIFACT_ENV("heat_env_");
 
-        private String value;
-
-        public String getValue() {
-            return value;
-        }
-
-        DeploymentArtifactCompositionRightMenu(String value) {
-            this.value = value;
-        }
+        private final String value;
 
     }
 
+    @AllArgsConstructor
+    @Getter
     public enum InputsScreenService {
         ADD_SELECTED_INPUTS_BTN("add-inputs-to-service-button"),
         VF_INSTANCE_ROWS("expand-collapse[expanded-selector^='.vf-instance-list.']"),
@@ -802,18 +631,12 @@
         RESOURCE_INSTANCE_PROPERTY_CHECKBOX("propertyCheckbox_"),
         SERVICE_INPUTS_DELETE_BUTTON("deleteInput_");
 
-        private String value;
-
-        public String getValue() {
-            return value;
-        }
-
-        InputsScreenService(String value) {
-            this.value = value;
-        }
+        private final String value;
 
     }
 
+    @AllArgsConstructor
+    @Getter
     public enum DeploymentScreen {
         MODULES("span[class^='expand-collapse-title-text']"),
         MEMBERS("div[class^='expand-collapse-sub-title']"),
@@ -837,19 +660,13 @@
         CANCEL("popover-close-button"),
         X_BUTTON("popover-x-button");
 
-        private String value;
+        private final String value;
 
-        public String getValue() {
-            return value;
-        }
-
-        DeploymentScreen(String value) {
-            this.value = value;
-        }
     }
 
+    @AllArgsConstructor
+    @Getter
     public enum PropertiesAssignmentScreen {
-
         PROPERTIES_TAB("Properties"),
         INPUTS_TAB("Inputs"),
         COMPOSITION_TAB("Composition"),
@@ -884,52 +701,35 @@
         FILTER_SET_BUTTON("filter-set-button"),
         PROPERTY_NAME_COLUMN("property-name");
 
-
-        private String value;
-
-        public String getValue() {
-            return value;
-        }
-
-        PropertiesAssignmentScreen(String value) {
-            this.value = value;
-        }
+        private final String value;
 
     }
 
+    @AllArgsConstructor
+    @Getter
     public enum ImportVfRepository {
         SEARCH("onboarding-search"),
         IMPORT_VSP("import-csar"),
         DOWNLOAD_CSAR("download-csar"),
         UPDATE_VSP("update-csar");
 
-        private String value;
+        private final String value;
 
-        public String getValue() {
-            return value;
-        }
-
-        ImportVfRepository(String value) {
-            this.value = value;
-        }
     }
 
+    @AllArgsConstructor
+    @Getter
     public enum EnvParameterView {
         SEARCH_ENV_PARAM_NAME("search-env-param-name"),
         ENV_CURRENT_VALUE("value-field-of-"), //value-field-of-oam_volume_name_0 - parameter name
         ENV_DEFAULT_VALUE("default-value-of-"); // default-value-of-vnf_name
 
-        private String value;
+        private final String value;
 
-        public String getValue() {
-            return value;
-        }
-
-        EnvParameterView(String value) {
-            this.value = value;
-        }
     }
 
+    @AllArgsConstructor
+    @Getter
     public enum ComplexServiceAmdocs {
         CREATE_BUTTON("Create"),
         DELETE_COMPONENT("deleteInstance"),
@@ -961,18 +761,13 @@
         SUBMIT_NEW_VSP_VERSION_DESCRIPTION("form-submit-button"),
         EXTEND_BUTTON("extendPathlnk");
 
-        private String value;
+        private final String value;
 
-        public String getValue() {
-            return value;
-        }
-
-        ComplexServiceAmdocs(String value) {
-            this.value = value;
-        }
     }
 
 
+    @AllArgsConstructor
+    @Getter
     public enum PortMirroring {
         COLLECTOR_NODE("collector_node"),
         EQUIP_MODEL("equip_model"),
@@ -980,17 +775,12 @@
         PMC_NAME_IN_PALLETE("Port Mirroring Configuration"),
         PMCP_NAME_IN_PALLETE("Port Mirroring Configuration By Policy");
 
-        private String value;
+        private final String value;
 
-        public String getValue() {
-            return value;
-        }
-
-        PortMirroring(String value) {
-            this.value = value;
-        }
     }
 
+    @AllArgsConstructor
+    @Getter
     public enum CompositionRightPanelGeneralInfo {
         TYPE("rightTab_componentType"),
         RESOURCE_TYPE("rightTab_resourceType"),
@@ -998,19 +788,13 @@
         CATEGORY("rightTab_category"),
         SUB_CATEGORY("rightTab_subCategory");
 
-        private String value;
+        private final String value;
 
-        public String getValue() {
-            return value;
-        }
-
-        CompositionRightPanelGeneralInfo(String value) {
-            this.value = value;
-        }
     }
 
+    @AllArgsConstructor
+    @Getter
     public enum CompositionRightPanel {
-
         COMPONENT_TITLE("selectedCompTitle"),
         REQS_AND_CAPS_TAB("requirements-and-capabilities"),
         EDIT_PENCIL("editPencil"),
@@ -1018,19 +802,13 @@
         DELETE_ITEM("deleteInstance"),
         REQS_AND_CAPS_TAB_XPATH("//button[@tooltip-content='Requirements and Capabilities']");
 
-        private String value;
+        private final String value;
 
-        public String getValue() {
-            return value;
-        }
-
-        CompositionRightPanel(String value) {
-            this.value = value;
-        }
     }
 
+    @AllArgsConstructor
+    @Getter
     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"),
@@ -1040,31 +818,18 @@
         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;
+        private final String value;
 
-        public String getValue() {
-            return value;
-        }
-
-        VspValidationPage(String value) {
-            this.value = value;
-        }
     }
 
+    @AllArgsConstructor
+    @Getter
     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;
+        private final String value;
 
-        public String getValue() {
-            return value;
-        }
-
-        VspValidationResultsPage(String value) {
-            this.value = value;
-        }
     }
 
 }
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceContainer.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceContainer.java
index 90d9661..8181ae9 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceContainer.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceContainer.java
@@ -28,13 +28,13 @@
     private Service service;
     private Resource resource;
     private VendorSoftwareProductObject vendorSoftwareProductObject;
-    private AmdocsLicenseMembers amdocsLicenseMembers;
+    private VendorLicenseModel vendorLicenseModel;
 
-    public ServiceContainer(Service service, Resource resource, VendorSoftwareProductObject vendorSoftwareProductObject, AmdocsLicenseMembers amdocsLicenseMembers) {
+    public ServiceContainer(Service service, Resource resource, VendorSoftwareProductObject vendorSoftwareProductObject, VendorLicenseModel vendorLicenseModel) {
         this.service = service;
         this.resource = resource;
         this.vendorSoftwareProductObject = vendorSoftwareProductObject;
-        this.amdocsLicenseMembers = amdocsLicenseMembers;
+        this.vendorLicenseModel = vendorLicenseModel;
     }
 
     public Service getService() {
@@ -61,11 +61,11 @@
         this.vendorSoftwareProductObject = vendorSoftwareProductObject;
     }
 
-    public AmdocsLicenseMembers getAmdocsLicenseMembers() {
-        return amdocsLicenseMembers;
+    public VendorLicenseModel getVendorLicenseModel() {
+        return vendorLicenseModel;
     }
 
-    public void setAmdocsLicenseMembers(AmdocsLicenseMembers amdocsLicenseMembers) {
-        this.amdocsLicenseMembers = amdocsLicenseMembers;
+    public void setVendorLicenseModel(VendorLicenseModel vendorLicenseModel) {
+        this.vendorLicenseModel = vendorLicenseModel;
     }
 }
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/exception/GeneralUiRuntimeException.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/exception/GeneralUiRuntimeException.java
new file mode 100644
index 0000000..9a4e0d1
--- /dev/null
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/exception/GeneralUiRuntimeException.java
@@ -0,0 +1,27 @@
+/*
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation
+ *  ================================================================================
+ *  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.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.exception;
+
+public class GeneralUiRuntimeException extends RuntimeException {
+
+    public GeneralUiRuntimeException(final String s, final Throwable throwable) {
+        super(s, throwable);
+    }
+}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/exception/HomePageRuntimeException.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/exception/HomePageRuntimeException.java
new file mode 100644
index 0000000..39bf648
--- /dev/null
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/exception/HomePageRuntimeException.java
@@ -0,0 +1,27 @@
+/*
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation
+ *  ================================================================================
+ *  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.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.exception;
+
+public class HomePageRuntimeException extends RuntimeException {
+
+    public HomePageRuntimeException(final String s, final Throwable throwable) {
+        super(s, throwable);
+    }
+}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/exception/PropertiesAssignmentPageException.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/exception/PropertiesAssignmentPageException.java
new file mode 100644
index 0000000..f0fbfeb3
--- /dev/null
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/exception/PropertiesAssignmentPageException.java
@@ -0,0 +1,27 @@
+/*
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation
+ *  ================================================================================
+ *  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.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.exception;
+
+public class PropertiesAssignmentPageException extends Exception {
+
+    public PropertiesAssignmentPageException(final String s, final Throwable throwable) {
+        super(s, throwable);
+    }
+}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/exception/WebDriverThreadRuntimeException.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/exception/WebDriverThreadRuntimeException.java
new file mode 100644
index 0000000..8ba4689
--- /dev/null
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/exception/WebDriverThreadRuntimeException.java
@@ -0,0 +1,28 @@
+/*
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation
+ *  ================================================================================
+ *  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.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.exception;
+
+public class WebDriverThreadRuntimeException extends RuntimeException {
+
+    public WebDriverThreadRuntimeException(final String s, final Throwable throwable) {
+        super(s, throwable);
+    }
+
+}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/CreatePath.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/CreatePath.java
index 57d7092..485b069 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/CreatePath.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/CreatePath.java
@@ -229,9 +229,9 @@
         //governor
         reloginWithNewRole(UserRoleEnum.GOVERNOR);
         GeneralUIUtils.findComponentAndClick(serviceMetadata1.getName());
-        GovernorOperationPage.approveSerivce(serviceMetadata1.getName());
+        GovernorOperationPage.approveService(serviceMetadata1.getName());
         GeneralUIUtils.findComponentAndClick(serviceMetadata2.getName());
-        GovernorOperationPage.approveSerivce(serviceMetadata2.getName());
+        GovernorOperationPage.approveService(serviceMetadata2.getName());
 
         //create service for complex service
         reloginWithNewRole(UserRoleEnum.DESIGNER);
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/ElementsChanges.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/ElementsChanges.java
index 828c37d..67d3f3d 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/ElementsChanges.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/ElementsChanges.java
@@ -544,9 +544,9 @@
         // governor
         reloginWithNewRole(UserRoleEnum.GOVERNOR);
         GeneralUIUtils.findComponentAndClick(serviceMetadata1.getName());
-        GovernorOperationPage.approveSerivce(serviceMetadata1.getName());
+        GovernorOperationPage.approveService(serviceMetadata1.getName());
         GeneralUIUtils.findComponentAndClick(serviceMetadata2.getName());
-        GovernorOperationPage.approveSerivce(serviceMetadata2.getName());
+        GovernorOperationPage.approveService(serviceMetadata2.getName());
 
         // create service for complex service
         reloginWithNewRole(UserRoleEnum.DESIGNER);
@@ -626,7 +626,7 @@
         //governor
         reloginWithNewRole(UserRoleEnum.GOVERNOR);
         GeneralUIUtils.findComponentAndClick(serviceMetadata1.getName());
-        GovernorOperationPage.approveSerivce(serviceMetadata1.getName());
+        GovernorOperationPage.approveService(serviceMetadata1.getName());
         return serviceMetadata1;
     }
 
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/PathUtilities.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/PathUtilities.java
index f181b4f..3ee26d3 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/PathUtilities.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/PathUtilities.java
@@ -39,6 +39,7 @@
 import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions;
 import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
 import org.openecomp.sdc.ci.tests.pages.CompositionPage;
+import org.openecomp.sdc.ci.tests.pages.GeneralPageElements;
 import org.openecomp.sdc.ci.tests.pages.HomePage;
 import org.openecomp.sdc.ci.tests.pages.ServiceGeneralPage;
 import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
@@ -72,7 +73,7 @@
 
     public static ServiceReqDetails createService(User user) throws Exception {
         ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
-        ServiceUIUtils.createService(serviceMetadata, user);
+        ServiceUIUtils.createService(serviceMetadata);
         ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
         GeneralUIUtils.ultimateWait();
         return serviceMetadata;
@@ -201,7 +202,7 @@
     public static void updateVF(String vspName, VendorSoftwareProductObject vendorSoftwareProduct) throws Exception {
         boolean vspFound = HomePage.searchForVSP(vspName);
         if (vspFound) {
-            List<WebElement> elementsFromTable = HomePage.getElemenetsFromTable();
+            final List<WebElement> elementsFromTable = GeneralPageElements.getElementsFromTable();
             elementsFromTable.get(1).click();
             GeneralUIUtils.waitForLoader();
             GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ImportVfRepository.UPDATE_VSP.getValue());
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/ArchiveRestoreTest.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/ArchiveRestoreTest.java
index f17d186..0e6bfc9 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/ArchiveRestoreTest.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/ArchiveRestoreTest.java
@@ -27,7 +27,7 @@
 import org.openecomp.sdc.be.model.Resource;
 import org.openecomp.sdc.be.model.Service;
 import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.datatypes.AmdocsLicenseMembers;
+import org.openecomp.sdc.ci.tests.datatypes.VendorLicenseModel;
 import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
 import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
 import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
@@ -69,11 +69,13 @@
 
 //      1. Import VSP v1.0
         String filePath = org.openecomp.sdc.ci.tests.utilities.FileHandling.getUpdateVSPVnfRepositoryPath();
-        AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(sdncDesignerDetails);
-        getExtendTest().log(Status.INFO, String.format("Creating Vendor Software License (VLM): %s v1.0", amdocsLicenseMembers.getVendorLicenseName()));
+        VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(sdncDesignerDetails);
+        getExtendTest().log(Status.INFO, String.format("Creating Vendor Software License (VLM): %s v1.0", vendorLicenseModel
+            .getVendorLicenseName()));
         ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
         getExtendTest().log(Status.INFO, String.format("Creating Vendor Software Product (VSP): %s v1.0 from heat file: %s ", resourceReqDetails.getName(), vnfFile1));
-        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile1, filePath, this.sdncDesignerDetails, amdocsLicenseMembers, null);
+        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile1, filePath, this.sdncDesignerDetails,
+            vendorLicenseModel, null);
 //		2. Create VF from VSP, certify - v1.0 is created
         resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
         Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
@@ -117,11 +119,13 @@
 
 //      1. Import VSP v1.0
         String filePath = org.openecomp.sdc.ci.tests.utilities.FileHandling.getUpdateVSPVnfRepositoryPath();
-        AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(sdncDesignerDetails);
-        getExtendTest().log(Status.INFO, String.format("Creating Vendor Software License (VLM): %s v1.0", amdocsLicenseMembers.getVendorLicenseName()));
+        VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(sdncDesignerDetails);
+        getExtendTest().log(Status.INFO, String.format("Creating Vendor Software License (VLM): %s v1.0", vendorLicenseModel
+            .getVendorLicenseName()));
         ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
         getExtendTest().log(Status.INFO, String.format("Creating Vendor Software Product (VSP): %s v1.0 from heat file: %s ", resourceReqDetails.getName(), vnfFile1));
-        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile1, filePath, this.sdncDesignerDetails, amdocsLicenseMembers, null);
+        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile1, filePath, this.sdncDesignerDetails,
+            vendorLicenseModel, null);
 //		2. Create VF from VSP, certify - v1.0 is created
         resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
         Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
@@ -163,11 +167,13 @@
         String vnfFile1 = "1-2017-404_vUSP_vCCF_AIC3.0-(VOIP)_v6.0.zip";
 //      1. Import VSP v1.0
         String filePath = org.openecomp.sdc.ci.tests.utilities.FileHandling.getUpdateVSPVnfRepositoryPath();
-        AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(sdncDesignerDetails);
-        getExtendTest().log(Status.INFO, String.format("Creating Vendor Software License (VLM): %s v1.0", amdocsLicenseMembers.getVendorLicenseName()));
+        VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(sdncDesignerDetails);
+        getExtendTest().log(Status.INFO, String.format("Creating Vendor Software License (VLM): %s v1.0", vendorLicenseModel
+            .getVendorLicenseName()));
         ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
         getExtendTest().log(Status.INFO, String.format("Creating Vendor Software Product (VSP): %s v1.0 from heat file: %s ", resourceReqDetails.getName(), vnfFile1));
-        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile1, filePath, this.sdncDesignerDetails, amdocsLicenseMembers, null);
+        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile1, filePath, this.sdncDesignerDetails,
+            vendorLicenseModel, null);
 //		2. Create VF from VSP, certify - v1.0 is created
         resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
         getExtendTest().log(Status.INFO, String.format("Creating Virtual Function (VF): %s v1.0", resourceReqDetails.getName()));
@@ -185,7 +191,7 @@
 
         reloginWithNewRole(UserRoleEnum.GOVERNOR);
         GeneralUIUtils.findComponentAndClick(service.getName());
-        GovernorOperationPage.approveSerivce(service.getName());
+        GovernorOperationPage.approveService(service.getName());
 //		4. archive VF(1.0)
         reloginWithNewRole(UserRoleEnum.DESIGNER);
         GeneralPageElements.clickArchivedButtonFromCatalog(resource.getName());
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/CatalogLeftPanelTest.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/CatalogLeftPanelTest.java
index 76483a3..f939dda 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/CatalogLeftPanelTest.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/CatalogLeftPanelTest.java
@@ -183,7 +183,7 @@
     public void lastUpdatedService() throws Exception {
         // create service
         ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
-        ServiceUIUtils.createService(serviceMetadata, getUser());
+        ServiceUIUtils.createService(serviceMetadata);
 
         ResourceGeneralPage.clickCheckinButton(serviceMetadata.getName());
         CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/CatalogLeftPanelTestWithTime.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/CatalogLeftPanelTestWithTime.java
index 87c1068..b38b54d 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/CatalogLeftPanelTestWithTime.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/CatalogLeftPanelTestWithTime.java
@@ -233,7 +233,7 @@
     public void lastUpdatedService() throws Exception {
         // create service
         ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
-        ServiceUIUtils.createService(serviceMetadata, getUser());
+        ServiceUIUtils.createService(serviceMetadata);
 
         ResourceGeneralPage.clickCheckinButton(serviceMetadata.getName());
         CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Categories.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Categories.java
index 57b6baa..844552c 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Categories.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Categories.java
@@ -158,7 +158,7 @@
         List<CategoryDefinition> categories = serviceMetadata.getCategories();
         categories.get(0).setName(newserviceCategory);
 
-        ServiceUIUtils.createService(serviceMetadata, getUser());
+        ServiceUIUtils.createService(serviceMetadata);
 
     }
 
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/CustomizationUUID.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/CustomizationUUID.java
index f41b32e..9bd14eb 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/CustomizationUUID.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/CustomizationUUID.java
@@ -82,7 +82,7 @@
 
         List customizationUUIDs = new ArrayList<String>();
         ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
-        ServiceUIUtils.createService(serviceMetadata, getUser());
+        ServiceUIUtils.createService(serviceMetadata);
 
 
         DeploymentArtifactPage.getLeftMenu().moveToCompositionScreen();
@@ -125,7 +125,7 @@
 
         List customizationUUIDs = new ArrayList<>();
         ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
-        ServiceUIUtils.createService(serviceMetadata, getUser());
+        ServiceUIUtils.createService(serviceMetadata);
 
         DeploymentArtifactPage.getLeftMenu().moveToCompositionScreen();
         CanvasManager canvasManager = CanvasManager.getCanvasManager();
@@ -181,7 +181,7 @@
 
         List customizationUUIDs = new ArrayList<>();
         ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
-        ServiceUIUtils.createService(serviceMetadata, getUser());
+        ServiceUIUtils.createService(serviceMetadata);
 
         DeploymentArtifactPage.getLeftMenu().moveToCompositionScreen();
         CanvasManager canvasManager = CanvasManager.getCanvasManager();
@@ -221,7 +221,7 @@
 
         List customizationUUIDs = new ArrayList<>();
         ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
-        ServiceUIUtils.createService(serviceMetadata, getUser());
+        ServiceUIUtils.createService(serviceMetadata);
 
         DeploymentArtifactPage.getLeftMenu().moveToCompositionScreen();
         CanvasManager canvasManager = CanvasManager.getCanvasManager();
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardViaApis.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardViaApis.java
index b595642..83e64ef 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardViaApis.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardViaApis.java
@@ -28,7 +28,7 @@
 import org.openecomp.sdc.be.model.Service;
 import org.openecomp.sdc.be.model.User;
 import org.openecomp.sdc.ci.tests.dataProvider.OnbordingDataProviders;
-import org.openecomp.sdc.ci.tests.datatypes.AmdocsLicenseMembers;
+import org.openecomp.sdc.ci.tests.datatypes.VendorLicenseModel;
 import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
 import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
 import org.openecomp.sdc.ci.tests.datatypes.VendorSoftwareProductObject;
@@ -95,9 +95,10 @@
     public void updateVSPFullScenario(String filepath, String vnfFile) throws Exception {
         //CREATE DATA REQUIRED FOR TEST
         boolean skipReport = true;
-        AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(sdncDesignerDetails1);
+        VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(sdncDesignerDetails1);
         ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
-        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createVendorSoftwareProduct(resourceReqDetails, vnfFile, filepath, sdncDesignerDetails1, amdocsLicenseMembers);
+        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createVendorSoftwareProduct(resourceReqDetails, vnfFile, filepath, sdncDesignerDetails1,
+            vendorLicenseModel);
         resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
         Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
         resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
@@ -108,11 +109,12 @@
         service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
         // TEST START
 
-        VendorLicenseModelRestUtils.updateVendorLicense(amdocsLicenseMembers, sdncDesignerDetails1, false);
-        VendorLicenseModelRestUtils.validateVlmExist(amdocsLicenseMembers.getVendorId(), amdocsLicenseMembers.getVersion(), sdncDesignerDetails1);
+        VendorLicenseModelRestUtils.updateVendorLicense(vendorLicenseModel, sdncDesignerDetails1, false);
+        VendorLicenseModelRestUtils.validateVlmExist(vendorLicenseModel.getVendorId(), vendorLicenseModel.getVersion(), sdncDesignerDetails1);
 
         // Update the VSP With the VLM new version and submit the VSP
-        vendorSoftwareProductObject = VendorSoftwareProductRestUtils.updateVSPWithNewVLMParameters(vendorSoftwareProductObject, amdocsLicenseMembers, sdncDesignerDetails1);
+        vendorSoftwareProductObject = VendorSoftwareProductRestUtils.updateVSPWithNewVLMParameters(vendorSoftwareProductObject,
+            vendorLicenseModel, sdncDesignerDetails1);
         VendorSoftwareProductRestUtils.validateVspExist(vendorSoftwareProductObject, sdncDesignerDetails1);
         Boolean distributeAndValidateService = AtomicOperationUtils.distributeAndValidateService(service);
         assertTrue("Distribution status is " + distributeAndValidateService, distributeAndValidateService);
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardingFlowsThroughAPI.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardingFlowsThroughAPI.java
index 125023c..136fcb5 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardingFlowsThroughAPI.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardingFlowsThroughAPI.java
@@ -27,8 +27,8 @@
 import org.openecomp.sdc.be.model.Resource;
 import org.openecomp.sdc.be.model.Service;
 import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.dataProviders.OnbordingDataProviders;
-import org.openecomp.sdc.ci.tests.datatypes.AmdocsLicenseMembers;
+import org.openecomp.sdc.ci.tests.data.providers.OnboardingDataProviders;
+import org.openecomp.sdc.ci.tests.datatypes.VendorLicenseModel;
 import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
 import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
 import org.openecomp.sdc.ci.tests.datatypes.TopMenuButtonsEnum;
@@ -83,9 +83,10 @@
         cvfcArtifacts.put(CvfcTypeEnum.VES_EVENTS, vesArtifactFileLocation);
         getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
 
-        AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(getUser());
+        VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
         ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
-        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails, amdocsLicenseMembers, cvfcArtifacts);
+        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
+            vendorLicenseModel, cvfcArtifacts);
         resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
         Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
         List<ComponentInstance> componentInstances = resource.getComponentInstances();
@@ -119,16 +120,17 @@
     @Test
     public void VlmReuse() throws Exception {
         List<String> fileNamesFromFolder = OnboardingUtils.getVnfNamesFileListExcludeToscaParserFailure();
-        List<String> newRandomFileNamesFromFolder = OnbordingDataProviders.getRandomElements(2, fileNamesFromFolder);
+        List<String> newRandomFileNamesFromFolder = OnboardingDataProviders.getRandomElements(2, fileNamesFromFolder);
         String filePath = FileHandling.getVnfRepositoryPath();
         String vnfFile = newRandomFileNamesFromFolder.get(0);
         getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
 //		setLog(vnfFile);
         getExtendTest().log(Status.INFO, "Create Vendor License");
-        AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(getUser());
+        VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
         ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
         getExtendTest().log(Status.INFO, "Create Vendor Software Product: " + resourceReqDetails.getName());
-        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails, amdocsLicenseMembers, null);
+        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
+            vendorLicenseModel, null);
         resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
         getExtendTest().log(Status.INFO, "Create Resource: " + resourceReqDetails.getName());
         Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
@@ -152,8 +154,9 @@
 //		update
         vnfFile = newRandomFileNamesFromFolder.get(1);
         getExtendTest().log(Status.INFO, "Going to update VLM with new file " + vnfFile);
-        VendorLicenseModelRestUtils.updateVendorLicense(amdocsLicenseMembers, sdncDesignerDetails, false);
-        vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails, amdocsLicenseMembers, null);
+        VendorLicenseModelRestUtils.updateVendorLicense(vendorLicenseModel, sdncDesignerDetails, false);
+        vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
+            vendorLicenseModel, null);
         getExtendTest().log(Status.INFO, "Create new VSP: " + vendorSoftwareProductObject.getName());
         resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
         getExtendTest().log(Status.INFO, "Create new resource: " + resourceReqDetails.getName());
@@ -181,13 +184,14 @@
     @Test
     public void updateVfiVersionOnServiceLevel() throws Throwable {
         List<String> fileNamesFromFolder = OnboardingUtils.getVnfNamesFileListExcludeToscaParserFailure();
-        List<String> newRandomFileNamesFromFolder = OnbordingDataProviders.getRandomElements(2, fileNamesFromFolder);
+        List<String> newRandomFileNamesFromFolder = OnboardingDataProviders.getRandomElements(2, fileNamesFromFolder);
         String filePath = FileHandling.getVnfRepositoryPath();
         String vnfFile = newRandomFileNamesFromFolder.get(0);
         getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
-        AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(getUser());
+        VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
         ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
-        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails, amdocsLicenseMembers, null);
+        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
+            vendorLicenseModel, null);
         resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
         Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
         resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
@@ -243,16 +247,17 @@
         // External Defect: 430425
 //		Import VSP v1.0
         List<String> fileNamesFromFolder = OnboardingUtils.getVnfNamesFileListExcludeToscaParserFailure();
-        List<String> newRandomFileNamesFromFolder = OnbordingDataProviders.getRandomElements(1, fileNamesFromFolder);
+        List<String> newRandomFileNamesFromFolder = OnboardingDataProviders.getRandomElements(1, fileNamesFromFolder);
         String filePath = FileHandling.getVnfRepositoryPath();
         String vnfFile = newRandomFileNamesFromFolder.get(0);
         getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
         User sdncDesignerDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
-        AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(sdncDesignerDetails1);
-        getExtendTest().log(Status.INFO, "Create Vendor License Model " + amdocsLicenseMembers.getVendorLicenseName());
+        VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(sdncDesignerDetails1);
+        getExtendTest().log(Status.INFO, "Create Vendor License Model " + vendorLicenseModel.getVendorLicenseName());
         ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
         getExtendTest().log(Status.INFO, "Create Vendor Software Product " + resourceReqDetails.getName());
-        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails, amdocsLicenseMembers, null);
+        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
+            vendorLicenseModel, null);
 
 //		Create VF, certify - v1.0 is created
         resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
@@ -265,7 +270,8 @@
         getExtendTest().log(Status.INFO, "Update VSP to version 2.0");
         String origVspName = vendorSoftwareProductObject.getName();
         vendorSoftwareProductObject.setName("Upd" + ElementFactory.generateUUIDforSufix());
-        vendorSoftwareProductObject = VendorSoftwareProductRestUtils.updateVSPWithNewVLMParameters(vendorSoftwareProductObject, amdocsLicenseMembers, sdncDesignerDetails1);
+        vendorSoftwareProductObject = VendorSoftwareProductRestUtils.updateVSPWithNewVLMParameters(vendorSoftwareProductObject,
+            vendorLicenseModel, sdncDesignerDetails1);
         VendorSoftwareProductRestUtils.validateVspExist(vendorSoftwareProductObject, sdncDesignerDetails1);
 
         //Validate that VF cannot be found by the updated VSP name
@@ -294,16 +300,17 @@
         // Test Case: 745821
 //		1. Import VSP v1.0
         List<String> fileNamesFromFolder = OnboardingUtils.getVnfNamesFileListExcludeToscaParserFailure();
-        List<String> newRandomFileNamesFromFolder = OnbordingDataProviders.getRandomElements(1, fileNamesFromFolder);
+        List<String> newRandomFileNamesFromFolder = OnboardingDataProviders.getRandomElements(1, fileNamesFromFolder);
         String filePath = FileHandling.getVnfRepositoryPath();
         String vnfFile = newRandomFileNamesFromFolder.get(0);
         getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
         User sdncDesignerDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
-        AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(sdncDesignerDetails1);
-        getExtendTest().log(Status.INFO, "Create Vendor License Model " + amdocsLicenseMembers.getVendorLicenseName());
+        VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(sdncDesignerDetails1);
+        getExtendTest().log(Status.INFO, "Create Vendor License Model " + vendorLicenseModel.getVendorLicenseName());
         ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
         getExtendTest().log(Status.INFO, "Create Vendor Software Product " + resourceReqDetails.getName());
-        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails, amdocsLicenseMembers, null);
+        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
+            vendorLicenseModel, null);
 //		2. Create VF, certify - v1.0 is created
         resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
         getExtendTest().log(Status.INFO, "Create VF " + resourceReqDetails.getName());
@@ -358,11 +365,13 @@
 //		1. Import VSP v1.0
         String filePath = org.openecomp.sdc.ci.tests.utilities.FileHandling.getUpdateVSPVnfRepositoryPath();
         User sdncDesignerDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
-        AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(sdncDesignerDetails1);
-        getExtendTest().log(Status.INFO, String.format("Creating Vendor Software License (VLM): %s v1.0", amdocsLicenseMembers.getVendorLicenseName()));
+        VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(sdncDesignerDetails1);
+        getExtendTest().log(Status.INFO, String.format("Creating Vendor Software License (VLM): %s v1.0", vendorLicenseModel
+            .getVendorLicenseName()));
         ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
         getExtendTest().log(Status.INFO, String.format("Creating Vendor Software Product (VSP): %s v1.0 from heat file: %s ", resourceReqDetails.getName(), vnfFile1));
-        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile1, filePath, sdncDesignerDetails, amdocsLicenseMembers, null);
+        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile1, filePath, sdncDesignerDetails,
+            vendorLicenseModel, null);
 //		2. Create VF, certify - v1.0 is created
         resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
         Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
@@ -418,11 +427,13 @@
 //		1. Import VSP v1.0
         //String filePath = FileHandling.getVnfRepositoryPath();
         User sdncDesignerDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
-        AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(sdncDesignerDetails1);
-        getExtendTest().log(Status.INFO, String.format("Creating Vendor Software License (VLM): %s v1.0", amdocsLicenseMembers.getVendorLicenseName()));
+        VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(sdncDesignerDetails1);
+        getExtendTest().log(Status.INFO, String.format("Creating Vendor Software License (VLM): %s v1.0", vendorLicenseModel
+            .getVendorLicenseName()));
         ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
         getExtendTest().log(Status.INFO, String.format("Creating Vendor Software Product (VSP): %s v1.0 from heat file: %s ", resourceReqDetails.getName(), vnfFile));
-        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails1, amdocsLicenseMembers);
+        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails1,
+            vendorLicenseModel);
 //		VendorSoftwareProductObject vendorSoftwareProductObject = OnboardViaApis.fillVendorSoftwareProductObjectWithMetaData(vnfFile, createVendorSoftwareProduct);
 //		2. Create VF, certify - v1.0 is created
         resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
@@ -451,11 +462,13 @@
         String filePath = FileHandling.getVnfRepositoryPath();
         String vnfFile1 = "1-VF-vCSCF-StateDB-new-update_v3.0.zip";
         User sdncDesignerDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
-        AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(sdncDesignerDetails1);
-        getExtendTest().log(Status.INFO, String.format("Creating Vendor Software License (VLM): %s v1.0", amdocsLicenseMembers.getVendorLicenseName()));
+        VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(sdncDesignerDetails1);
+        getExtendTest().log(Status.INFO, String.format("Creating Vendor Software License (VLM): %s v1.0", vendorLicenseModel
+            .getVendorLicenseName()));
         ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
         getExtendTest().log(Status.INFO, String.format("Creating Vendor Software Product (VSP): %s v1.0 from heat file: %s ", resourceReqDetails.getName(), vnfFile1));
-        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createVendorSoftwareProduct(resourceReqDetails, vnfFile1, filePath, sdncDesignerDetails1, amdocsLicenseMembers);
+        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createVendorSoftwareProduct(resourceReqDetails, vnfFile1, filePath, sdncDesignerDetails1,
+            vendorLicenseModel);
 //			VendorSoftwareProductObject vendorSoftwareProductObject = OnboardViaApis.fillVendorSoftwareProductObjectWithMetaData(vnfFile1, createVendorSoftwareProduct);
 //			2. Create VF, certify - v1.0 is created
         resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
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
similarity index 78%
rename from ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardingFlowsUI.java
rename to ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardingFlowsUi.java
index d883420..595c438 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
@@ -20,14 +20,27 @@
 
 package org.openecomp.sdc.ci.tests.execute.sanity;
 
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertTrue;
+import static org.testng.AssertJUnit.fail;
+
 import com.aventstack.extentreports.Status;
+import java.io.File;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import org.openecomp.sdc.ci.tests.data.providers.OnboardingDataProviders;
 import org.openecomp.sdc.ci.tests.dataProvider.OnbordingDataProviders;
-import org.openecomp.sdc.ci.tests.datatypes.AmdocsLicenseMembers;
 import org.openecomp.sdc.ci.tests.datatypes.CanvasElement;
 import org.openecomp.sdc.ci.tests.datatypes.CanvasManager;
 import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
 import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
 import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.VendorLicenseModel;
 import org.openecomp.sdc.ci.tests.datatypes.VendorSoftwareProductObject;
 import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
 import org.openecomp.sdc.ci.tests.datatypes.enums.XnfTypeEnum;
@@ -38,6 +51,7 @@
 import org.openecomp.sdc.ci.tests.pages.DeploymentArtifactPage;
 import org.openecomp.sdc.ci.tests.pages.GovernorOperationPage;
 import org.openecomp.sdc.ci.tests.pages.HomePage;
+import org.openecomp.sdc.ci.tests.pages.HomePage.PageElement;
 import org.openecomp.sdc.ci.tests.pages.OpsOperationPage;
 import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
 import org.openecomp.sdc.ci.tests.pages.ServiceGeneralPage;
@@ -55,76 +69,70 @@
 import org.openecomp.sdc.ci.tests.utils.general.VendorSoftwareProductRestUtils;
 import org.openecomp.sdc.ci.tests.verificator.ServiceVerificator;
 import org.openqa.selenium.WebElement;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.testng.AssertJUnit;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Optional;
 import org.testng.annotations.Parameters;
 import org.testng.annotations.Test;
 
-import java.io.File;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
+public class OnboardingFlowsUi extends SetupCDTest {
 
-import static org.testng.AssertJUnit.assertNotNull;
-import static org.testng.AssertJUnit.assertTrue;
-
-public class OnboardingFlowsUI extends SetupCDTest {
+    private static final Logger LOGGER = LoggerFactory.getLogger(OnboardingFlowsUi.class);
 
     protected static String filePath = FileHandling.getVnfRepositoryPath();
-    private String makeDistributionValue;
+    private Boolean makeDistributionValue;
 
     @Parameters({"makeDistribution"})
     @BeforeMethod
     public void beforeTestReadParams(@Optional("true") String makeDistributionReadValue) {
-        makeDistributionValue = makeDistributionReadValue;
+        LOGGER.debug("makeDistribution parameter is '{}'", makeDistributionReadValue);
+        makeDistributionValue = Boolean.valueOf(makeDistributionReadValue);
     }
 
     @Test
-    public void onboardVNFTestSanityOneFile() throws Throwable {
+    public void onboardVNFTestSanityOneFile() throws Exception {
         String vnfFile = "1-VF-vUSP-vCCF-DB_v11.1.zip";
-        ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
-        ServiceReqDetails serviceReqDetails = ElementFactory.getDefaultService(); //getServiceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
+        ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
+        ServiceReqDetails serviceReqDetails = ElementFactory.getDefaultService();
         runOnboardToDistributionFlow(resourceReqDetails, serviceReqDetails, filePath, vnfFile);
     }
 
     @Test
-    public void performanceTest() throws Throwable {
-        System.out.println("Start test");
+    public void performanceTest() throws Exception {
+        LOGGER.debug("Start test");
         Long actualTestRunTime = Utils.getActionDuration(() -> {
             try {
                 onboardVNFTestSanityOneFile();
-            } catch (Throwable throwable) {
-                throwable.printStackTrace();
+            } catch (final Exception e) {
+                LOGGER.debug("An error has occurred during the performance test", e);
             }
         });
-        Long regularTestRunTime = 400L;
+        long regularTestRunTime = 400L;
         double factor = 1.5;
         assertTrue("Expected test run time should be less from " + regularTestRunTime * factor + ", actual time is " + actualTestRunTime, regularTestRunTime * factor > actualTestRunTime);
     }
 
     @Test
-    public void onboardVNFTestSanity() throws Throwable {
+    public void onboardVNFTestSanity() throws Exception {
         List<String> fileNamesFromFolder = OnboardingUtils.getXnfNamesFileList(XnfTypeEnum.VNF);
-        String vnfFile = fileNamesFromFolder.get(0).toString();
-        ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
-        ServiceReqDetails serviceReqDetails = ElementFactory.getDefaultService(); //getServiceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
+        String vnfFile = fileNamesFromFolder.get(0);
+        ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
+        ServiceReqDetails serviceReqDetails = ElementFactory.getDefaultService();
         runOnboardToDistributionFlow(resourceReqDetails, serviceReqDetails, filePath, vnfFile);
     }
 
-    @Test(dataProviderClass = org.openecomp.sdc.ci.tests.dataProviders.OnbordingDataProviders.class, dataProvider = "Single_VNF")
-    public void onapOnboardVNFflow(String filePath, String vnfFile) throws Exception, Throwable {
+    @Test(dataProviderClass = OnboardingDataProviders.class, dataProvider = "Single_VNF")
+    public void onapOnboardVNFflow(String filePath, String vnfFile) throws Exception {
         setLog(vnfFile);
-        ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
-        ServiceReqDetails serviceReqDetails = ElementFactory.getDefaultService(); //getServiceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
-        System.out.println("print - >" + makeDistributionValue);
+        ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
+        ServiceReqDetails serviceReqDetails = ElementFactory.getDefaultService();
         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 {
+    @Test(dataProviderClass = OnboardingDataProviders.class, dataProvider = "Single_VNF")
+    public void onapOnboardVSPValidationsSanityFlow(String filePath, String vnfFile) throws Exception {
         setLog(vnfFile);
         String vspName = createNewVSP(filePath, vnfFile);
         if (OnboardingUiUtils.getVspValidationCongiguration()) {
@@ -146,9 +154,8 @@
         }
     }
 
-
-    @Test(dataProviderClass = org.openecomp.sdc.ci.tests.dataProviders.OnbordingDataProviders.class, dataProvider = "Single_VNF")
-    public void onapOnboardVSPValidationsConfigurationChangeCheck(String filePath, String vnfFile) throws Exception, Throwable {
+    @Test(dataProviderClass = OnboardingDataProviders.class, dataProvider = "Single_VNF")
+    public void onapOnboardVSPValidationsConfigurationChangeCheck(String filePath, String vnfFile) throws Exception {
         setLog(vnfFile);
         String vspName = createNewVSP(filePath, vnfFile);
         if (OnboardingUiUtils.getVspValidationCongiguration()) {
@@ -173,8 +180,8 @@
         }
     }
 
-    @Test(dataProviderClass = org.openecomp.sdc.ci.tests.dataProviders.OnbordingDataProviders.class, dataProvider = "Single_VNF")
-    public void onapOnboardVSPCertificationQueryFlow(String filePath, String vnfFile) throws Exception, Throwable {
+    @Test(dataProviderClass = OnboardingDataProviders.class, dataProvider = "Single_VNF")
+    public void onapOnboardVSPCertificationQueryFlow(String filePath, String vnfFile) throws Exception {
         setLog(vnfFile);
         String vspName = createNewVSP(filePath, vnfFile);
         if (!OnboardingUiUtils.getVspValidationCongiguration()) {
@@ -201,8 +208,8 @@
 
     }
 
-    @Test(dataProviderClass = org.openecomp.sdc.ci.tests.dataProviders.OnbordingDataProviders.class, dataProvider = "Single_VNF")
-    public void onapOnboardVSPComplianceCheckFlow(String filePath, String vnfFile) throws Exception, Throwable {
+    @Test(dataProviderClass = OnboardingDataProviders.class, dataProvider = "Single_VNF")
+    public void onapOnboardVSPComplianceCheckFlow(String filePath, String vnfFile) throws Exception {
         setLog(vnfFile);
         String vspName = createNewVSP(filePath, vnfFile);
         final String complianceNotAvailableLabel = "No Compliance Checks are Available";
@@ -218,7 +225,8 @@
         if (VspValidationPage.checkComplianceCheckExists()) {
             VspValidationPage.clickComplianceChecksAll();
             GeneralUIUtils.ultimateWait();
-            assertTrue("Next Button is disabled, it should have been enabled", !VspValidationPage.checkNextButtonDisabled());
+            assertFalse("Next Button is disabled, it should have been enabled",
+                VspValidationPage.checkNextButtonDisabled());
             VspValidationPage.clickOnNextButton();
             GeneralUIUtils.ultimateWait();
             VspValidationPage.clickOnSubmitButton();
@@ -230,7 +238,7 @@
 
     }
 
-    @Test(dataProviderClass = org.openecomp.sdc.ci.tests.dataProviders.OnbordingDataProviders.class, dataProvider = "Single_VNF")
+    @Test(dataProviderClass = OnboardingDataProviders.class, dataProvider = "Single_VNF")
     public void onapOnboardVSPComplianceCheckOperations(String filePath, String vnfFile) throws Exception {
         setLog(vnfFile);
         String vspName = createNewVSP(filePath, vnfFile);
@@ -244,20 +252,22 @@
         VspValidationPage.navigateToVspValidationPageUsingNavbar();
         assertTrue("Next Button is enabled, it should have been enabled", VspValidationPage.checkNextButtonDisabled());
         if (VspValidationPage.checkComplianceCheckExists()) {
-            assertTrue("The tests are already selected, the list should initially be empty", !VspValidationPage.checkSelectedComplianceCheckExists());
+            assertFalse("The tests are already selected, the list should initially be empty",
+                VspValidationPage.checkSelectedComplianceCheckExists());
             VspValidationPage.clickComplianceChecksAll();
             GeneralUIUtils.ultimateWait();
             assertTrue("The selected tests are not populated in the list", VspValidationPage.checkSelectedComplianceCheckExists());
             VspValidationPage.clickComplianceChecksAll();
             GeneralUIUtils.ultimateWait();
-            assertTrue("The selected tests are not deleted from the list", !VspValidationPage.checkSelectedComplianceCheckExists());
+            assertFalse("The selected tests are not deleted from the list",
+                VspValidationPage.checkSelectedComplianceCheckExists());
         } else {
             assertNotNull(GeneralUIUtils.findByText("No Compliance Checks are Available"));
         }
 
     }
 
-    @Test(dataProviderClass = org.openecomp.sdc.ci.tests.dataProviders.OnbordingDataProviders.class, dataProvider = "Single_VNF")
+    @Test(dataProviderClass = OnboardingDataProviders.class, dataProvider = "Single_VNF")
     public void onapOnboardVSPCertificationQueryOperations(String filePath, String vnfFile) throws Exception {
         setLog(vnfFile);
         String vspName = createNewVSP(filePath, vnfFile);
@@ -271,13 +281,15 @@
         VspValidationPage.navigateToVspValidationPageUsingNavbar();
         assertTrue("Next Button is enabled, it should have been enabled", VspValidationPage.checkNextButtonDisabled());
         if (VspValidationPage.checkCertificationQueryExists()) {
-            assertTrue("The tests are already selected, the list should initially be empty", !VspValidationPage.checkSelectedCertificationQueryExists());
+            assertFalse("The tests are already selected, the list should initially be empty",
+                VspValidationPage.checkSelectedCertificationQueryExists());
             VspValidationPage.clickCertificationQueryAll();
             GeneralUIUtils.ultimateWait();
             assertTrue("The selected tests are not populated in the list", VspValidationPage.checkSelectedCertificationQueryExists());
             VspValidationPage.clickCertificationQueryAll();
             GeneralUIUtils.ultimateWait();
-            assertTrue("The selected tests are not deleted from the list", !VspValidationPage.checkSelectedCertificationQueryExists());
+            assertFalse("The selected tests are not deleted from the list",
+                VspValidationPage.checkSelectedCertificationQueryExists());
         } else {
             assertNotNull(GeneralUIUtils.findByText("No Compliance Checks are Available"));
         }
@@ -310,10 +322,11 @@
 
         //revert the config
         OnboardingUiUtils.putVspValidationCongiguration(vspConfig);
-        assertTrue(String.format("Failed to revert Congiguration to %s", vspConfig), OnboardingUiUtils.getVspValidationCongiguration() == vspConfig);
+        assertEquals(String.format("Failed to revert Configuration to %s", vspConfig), vspConfig,
+            OnboardingUiUtils.getVspValidationCongiguration());
     }
 
-    private void goToVspScreen(boolean isCurrentScreenCatalogPage, String vspName) throws Exception {
+    private void goToVspScreen(boolean isCurrentScreenCatalogPage, String vspName) {
         if (isCurrentScreenCatalogPage) {
             GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.MainMenuButtons.ONBOARD_BUTTON.getValue());
         }
@@ -326,22 +339,18 @@
         return OnboardingUiUtils.createVSP(resourceReqDetails, vnfFile, filePath, getUser()).getName();
     }
 
-    public void runOnboardToDistributionFlow(ResourceReqDetails resourceReqDetails, ServiceReqDetails serviceMetadata, String filePath, String vnfFile) throws Exception {
+    private 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()
                 + " and service category: " + serviceMetadata.getCategory());
-        String vspName = onboardAndCertify(resourceReqDetails, filePath, vnfFile);
+        final String vspName = onboardAndCertify(resourceReqDetails, filePath, vnfFile);
 
-        //TODO Andrey check return window after certification
-        /*reloginWithNewRole(UserRoleEnum.DESIGNER);*/
-        // create service
-//		ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
-        ServiceUIUtils.createService(serviceMetadata, getUser());
+        ServiceUIUtils.createService(serviceMetadata);
 
         ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
         CompositionPage.searchForElement(vspName);
-        CanvasManager serviceCanvasManager = CanvasManager.getCanvasManager();
-        CanvasElement vfElement = serviceCanvasManager.createElementOnCanvas(vspName);
+        final CanvasManager serviceCanvasManager = CanvasManager.getCanvasManager();
+        final CanvasElement vfElement = serviceCanvasManager.createElementOnCanvas(vspName);
         ArtifactsCorrelationManager.addVNFtoServiceArtifactCorrelation(serviceMetadata.getName(), vspName);
 
         assertNotNull(vfElement);
@@ -355,30 +364,30 @@
         TesterOperationPage.certifyComponent(serviceMetadata.getName());
 
         reloginWithNewRole(UserRoleEnum.GOVERNOR);
-        GeneralUIUtils.findComponentAndClick(serviceMetadata.getName());
-        GovernorOperationPage.approveSerivce(serviceMetadata.getName());
+        HomePage.waitForElement(PageElement.COMPONENT_PANEL);
+        HomePage.findComponentAndClick(serviceMetadata.getName());
+        GovernorOperationPage.approveService(serviceMetadata.getName());
 
-        if (makeDistributionValue.equals("true")) {
+        runDistributionFlow(serviceMetadata);
 
+        getExtendTest().log(Status.INFO, String.format("Successfully onboarded the package '%s'", vnfFile));
+    }
 
+    private void runDistributionFlow(final ServiceReqDetails serviceMetadata) throws Exception {
+        if (makeDistributionValue) {
             reloginWithNewRole(UserRoleEnum.OPS);
             GeneralUIUtils.findComponentAndClick(serviceMetadata.getName());
             OpsOperationPage.distributeService();
             OpsOperationPage.displayMonitor();
 
-            List<WebElement> rowsFromMonitorTable = OpsOperationPage.getRowsFromMonitorTable();
+            final List<WebElement> rowsFromMonitorTable = OpsOperationPage.getRowsFromMonitorTable();
             AssertJUnit.assertEquals(1, rowsFromMonitorTable.size());
 
             OpsOperationPage.waitUntilArtifactsDistributed(0);
-
-//		validateInputArtsVSouput(serviceMetadata.getName());
-
         }
-
-        getExtendTest().log(Status.INFO, String.format("The onboarding %s test is passed ! ", vnfFile));
     }
 
-    public String onboardAndCertify(ResourceReqDetails resourceReqDetails, String filePath, String vnfFile) throws Exception {
+    private String onboardAndCertify(ResourceReqDetails resourceReqDetails, String filePath, String vnfFile) throws Exception {
         VendorSoftwareProductObject onboardAndValidate = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, filePath, vnfFile, getUser());
         String vspName = onboardAndValidate.getName();
 
@@ -391,27 +400,24 @@
 
 
     @Test(dataProviderClass = OnbordingDataProviders.class, dataProvider = "VNF_List")
-    public void onboardVNFTest(String filePath, String vnfFile) throws Throwable {
+    public void onboardVNFTest(String filePath, String vnfFile) throws Exception {
         setLog(vnfFile);
-        System.out.println("printttttttttttttt - >" + makeDistributionValue);
         ResourceReqDetails resourceReqDetails = ElementFactory.getRandomCategoryResource();
         ServiceReqDetails serviceReqDetails = ElementFactory.getRandomCategoryService();
         runOnboardToDistributionFlow(resourceReqDetails, serviceReqDetails, filePath, vnfFile);
     }
 
     @Test(dataProviderClass = OnbordingDataProviders.class, dataProvider = "VNF_List")
-    public void onboardVNFShotFlow(String filePath, String vnfFile) throws Throwable {
+    public void onboardVNFShotFlow(String filePath, String vnfFile) throws Exception {
         setLog(vnfFile);
-        System.out.println("printttttttttttttt - >" + makeDistributionValue);
-        ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
+        ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
         onboardAndCertify(resourceReqDetails, filePath, vnfFile);
     }
 
     @Test(dataProviderClass = OnbordingDataProviders.class, dataProvider = "randomVNF_List")
-    public void onboardRandomVNFsTest(String filePath, String vnfFile) throws Throwable {
+    public void onboardRandomVNFsTest(String filePath, String vnfFile) throws Exception {
         setLog(vnfFile);
-        System.out.println("printttttttttttttt - >" + makeDistributionValue);
-        System.out.println("Vnf File name is: " + vnfFile);
+        LOGGER.debug("Vnf File name is: {}", vnfFile);
         ResourceReqDetails resourceReqDetails = ElementFactory.getRandomCategoryResource();
         ServiceReqDetails serviceReqDetails = ElementFactory.getRandomCategoryService();
         runOnboardToDistributionFlow(resourceReqDetails, serviceReqDetails, filePath, vnfFile);
@@ -419,17 +425,17 @@
 
 
     @Test
-    public void onboardUpdateVNFTest() throws Throwable {
+    public void onboardUpdateVNFTest() throws Exception {
         List<String> fileNamesFromFolder = FileHandling.getZipFileNamesFromFolder(filePath);
         String vnfFile = fileNamesFromFolder.get(0);
-        ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
+        ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
         VendorSoftwareProductObject vsp = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, filePath, vnfFile, getUser());
         String vspName = vsp.getName();
         ResourceGeneralPage.clickCertifyButton(vspName);
 
         // create service
         ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
-        ServiceUIUtils.createService(serviceMetadata, getUser());
+        ServiceUIUtils.createService(serviceMetadata);
 
         ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
         CompositionPage.searchForElement(vspName);
@@ -438,7 +444,9 @@
         assertNotNull(vfElement);
         ServiceVerificator.verifyNumOfComponentInstances(serviceMetadata, "0.1", 1, getUser());
 
-        HomePage.navigateToHomePage();
+        if (!HomePage.navigateToHomePage()) {
+            fail("Could not go to the home page");
+        }
 
         ///update flow
         String updatedVnfFile = fileNamesFromFolder.get(1);
@@ -464,7 +472,7 @@
 
         reloginWithNewRole(UserRoleEnum.GOVERNOR);
         GeneralUIUtils.findComponentAndClick(serviceMetadata.getName());
-        GovernorOperationPage.approveSerivce(serviceMetadata.getName());
+        GovernorOperationPage.approveService(serviceMetadata.getName());
 
 
         reloginWithNewRole(UserRoleEnum.OPS);
@@ -482,19 +490,24 @@
 
     @Test
     public void threeVMMSCsInServiceTest() throws Exception {
-
         String pathFile = FileHandling.getFilePath("VmmscArtifacts");
-        List<String> vmmscList = Arrays.asList(new File(pathFile).list()).stream().filter(e -> e.contains("vmmsc") && e.endsWith(".zip")).collect(Collectors.toList());
-        assertTrue("Did not find vMMSCs", vmmscList.size() > 0);
+        final String[] list = new File(pathFile).list();
+        assertNotNull("Did not find vMMSCs", list);
+        assertFalse("Did not find vMMSCs", list.length == 0);
+        List<String> vmmscList = Arrays.stream(list).filter(e -> e.contains("vmmsc") && e.endsWith(".zip"))
+            .collect(Collectors.toList());
+        assertFalse("Did not find vMMSCs", vmmscList.isEmpty());
 
         Map<String, String> vspNames = new HashMap<>();
         for (String vnfFile : vmmscList) {
-            getExtendTest().log(Status.INFO, String.format("Going to onboard the VNF %s......", vnfFile));
-            System.out.println(String.format("Going to onboard the VNF %s......", vnfFile));
+            String msg = String.format("Going to onboard the VNF %s", vnfFile);
+            getExtendTest().log(Status.INFO, msg);
+            LOGGER.info(msg);
 
-            AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(getUser());
-            ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
-            VendorSoftwareProductObject createVendorSoftwareProduct = VendorSoftwareProductRestUtils.createVendorSoftwareProduct(resourceReqDetails, vnfFile, pathFile, getUser(), amdocsLicenseMembers);
+            VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
+            ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
+            VendorSoftwareProductObject createVendorSoftwareProduct = VendorSoftwareProductRestUtils
+                .createVendorSoftwareProduct(resourceReqDetails, vnfFile, pathFile, getUser(), vendorLicenseModel);
 
             getExtendTest().log(Status.INFO, String.format("Searching for onboarded %s", vnfFile));
             HomePage.showVspRepository();
@@ -508,17 +521,10 @@
             DeploymentArtifactPage.clickCertifyButton(vspName);
             vspNames.put(vnfFile, vspName);
         }
-		
-	/*	reloginWithNewRole(UserRoleEnum.TESTER);
-		for (String vsp : vspNames.values()){
-			GeneralUIUtils.findComponentAndClick(vsp);
-			TesterOperationPage.certifyComponent(vsp);
-		}
-		
-		reloginWithNewRole(UserRoleEnum.DESIGNER);*/
+
         // create service
         ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
-        ServiceUIUtils.createService(serviceMetadata, getUser());
+        ServiceUIUtils.createService(serviceMetadata);
         ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
         CanvasManager serviceCanvasManager = CanvasManager.getCanvasManager();
 
@@ -540,7 +546,7 @@
 
         reloginWithNewRole(UserRoleEnum.GOVERNOR);
         GeneralUIUtils.findComponentAndClick(serviceMetadata.getName());
-        GovernorOperationPage.approveSerivce(serviceMetadata.getName());
+        GovernorOperationPage.approveService(serviceMetadata.getName());
 
         reloginWithNewRole(UserRoleEnum.OPS);
         GeneralUIUtils.findComponentAndClick(serviceMetadata.getName());
@@ -551,7 +557,6 @@
         AssertJUnit.assertEquals(1, rowsFromMonitorTable.size());
 
         OpsOperationPage.waitUntilArtifactsDistributed(0);
-
     }
 
 
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PNF.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PNF.java
index 97a7010..a39e4f2 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PNF.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PNF.java
@@ -378,7 +378,7 @@
 
         /*reloginWithNewRole(UserRoleEnum.DESIGNER);*/
         ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
-        ServiceUIUtils.createService(serviceMetadata, getUser());
+        ServiceUIUtils.createService(serviceMetadata);
         DeploymentArtifactPage.getLeftMenu().moveToCompositionScreen();
         CanvasManager canvasManager = CanvasManager.getCanvasManager();
         CompositionPage.searchForElement(pnfName);
@@ -394,7 +394,7 @@
 
         reloginWithNewRole(UserRoleEnum.GOVERNOR);
         GeneralUIUtils.findComponentAndClick(serviceName);
-        GovernorOperationPage.approveSerivce(serviceName);
+        GovernorOperationPage.approveService(serviceName);
 
         reloginWithNewRole(UserRoleEnum.OPS);
         GeneralUIUtils.findComponentAndClick(serviceName);
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Product.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Product.java
index 877858b..15f0456 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Product.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Product.java
@@ -48,7 +48,7 @@
         ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
         ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
 
-        ServiceUIUtils.createService(serviceMetadata, getUser());
+        ServiceUIUtils.createService(serviceMetadata);
         GeneralPageElements.clickSubmitForTestingButton(serviceMetadata.getName());
         reloginWithNewRole(UserRoleEnum.TESTER);
         GeneralUIUtils.findComponentAndClick(serviceMetadata.getName());
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PropertiesAssignmentUpdateFlow.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PropertiesAssignmentUpdateFlow.java
index 8610924..ec2b88d 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PropertiesAssignmentUpdateFlow.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PropertiesAssignmentUpdateFlow.java
@@ -27,7 +27,7 @@
 import org.openecomp.sdc.be.model.ComponentInstance;
 import org.openecomp.sdc.be.model.Resource;
 import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.datatypes.AmdocsLicenseMembers;
+import org.openecomp.sdc.ci.tests.datatypes.VendorLicenseModel;
 import org.openecomp.sdc.ci.tests.datatypes.CanvasElement;
 import org.openecomp.sdc.ci.tests.datatypes.CanvasManager;
 import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
@@ -70,9 +70,6 @@
 
 import static org.testng.Assert.assertTrue;
 
-//import com.sun.xml.internal.bind.v2.TODO;
-
-
 public class PropertiesAssignmentUpdateFlow extends SetupCDTest {
 
     private static String filePath;
@@ -238,9 +235,10 @@
         //Import VSP, create VF - v0.1
         String filePath = org.openecomp.sdc.ci.tests.utils.general.FileHandling.getVnfRepositoryPath();
         getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
-        AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(getUser());
+        VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
         ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
-        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails, amdocsLicenseMembers, null);
+        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
+            vendorLicenseModel, null);
         resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
         Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
 
@@ -320,9 +318,10 @@
         //Import VSP, create VF - v0.1
         String filePath = org.openecomp.sdc.ci.tests.utils.general.FileHandling.getVnfRepositoryPath();
         getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
-        AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(getUser());
+        VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
         ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
-        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails, amdocsLicenseMembers, null);
+        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
+            vendorLicenseModel, null);
         resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
         Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
 
@@ -393,9 +392,10 @@
         //Import VSP, create VF - v0.1
         String filePath = org.openecomp.sdc.ci.tests.utils.general.FileHandling.getVnfRepositoryPath();
         getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
-        AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(getUser());
+        VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
         ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
-        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails, amdocsLicenseMembers, null);
+        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
+            vendorLicenseModel, null);
         resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
         Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
 
@@ -603,9 +603,10 @@
         //Import VSP, create VF - v0.1
         String filePath = org.openecomp.sdc.ci.tests.utils.general.FileHandling.getVnfRepositoryPath();
         getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
-        AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(getUser());
+        VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
         ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
-        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails, amdocsLicenseMembers, null);
+        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
+            vendorLicenseModel, null);
         resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
         Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
 
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PropertiesAssignmentUpdateFlow_New.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PropertiesAssignmentUpdateFlow_New.java
index 17a936f..92123f6 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PropertiesAssignmentUpdateFlow_New.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PropertiesAssignmentUpdateFlow_New.java
@@ -26,7 +26,7 @@
 import org.openecomp.sdc.be.model.ComponentInstance;
 import org.openecomp.sdc.be.model.Resource;
 import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.datatypes.AmdocsLicenseMembers;
+import org.openecomp.sdc.ci.tests.datatypes.VendorLicenseModel;
 import org.openecomp.sdc.ci.tests.datatypes.CanvasElement;
 import org.openecomp.sdc.ci.tests.datatypes.CanvasManager;
 import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
@@ -69,9 +69,6 @@
 
 import static org.testng.Assert.assertTrue;
 
-//import com.sun.xml.internal.bind.v2.TODO;
-
-
 public class PropertiesAssignmentUpdateFlow_New extends SetupCDTest {
 
     private static String filePath;
@@ -259,9 +256,10 @@
         //Import VSP, create VF - v0.1
         String filePath = org.openecomp.sdc.ci.tests.utils.general.FileHandling.getVnfRepositoryPath();
         getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
-        AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(getUser());
+        VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
         ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
-        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails, amdocsLicenseMembers, null);
+        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
+            vendorLicenseModel, null);
         resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
         Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
 
@@ -305,9 +303,10 @@
         //Import VSP, create VF - v0.1
         String filePath = org.openecomp.sdc.ci.tests.utils.general.FileHandling.getVnfRepositoryPath();
         getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
-        AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(getUser());
+        VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
         ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
-        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails, amdocsLicenseMembers, null);
+        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
+            vendorLicenseModel, null);
         resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
         Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
 
@@ -349,9 +348,10 @@
         //Import VSP, create VF - v0.1
         String filePath = org.openecomp.sdc.ci.tests.utils.general.FileHandling.getVnfRepositoryPath();
         getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
-        AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(getUser());
+        VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
         ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
-        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails, amdocsLicenseMembers, null);
+        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
+            vendorLicenseModel, null);
         resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
         Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
 
@@ -396,9 +396,10 @@
         //Import VSP, create VF - v0.1
         String filePath = org.openecomp.sdc.ci.tests.utils.general.FileHandling.getVnfRepositoryPath();
         getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
-        AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(getUser());
+        VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
         ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
-        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails, amdocsLicenseMembers, null);
+        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
+            vendorLicenseModel, null);
         resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
         Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
 
@@ -461,9 +462,10 @@
         //Import VSP, create VF - v0.1
         String filePath = org.openecomp.sdc.ci.tests.utils.general.FileHandling.getVnfRepositoryPath();
         getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
-        AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(getUser());
+        VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
         ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
-        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails, amdocsLicenseMembers, null);
+        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
+            vendorLicenseModel, null);
         resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
         Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
 
@@ -519,9 +521,10 @@
         //Import VSP, create VF - v0.1
         String filePath = org.openecomp.sdc.ci.tests.utils.general.FileHandling.getVnfRepositoryPath();
         getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
-        AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(getUser());
+        VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
         ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
-        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails, amdocsLicenseMembers, null);
+        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
+            vendorLicenseModel, null);
         resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
         Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
 
@@ -583,9 +586,10 @@
         //Import VSP, create VF - v0.1
         String filePath = org.openecomp.sdc.ci.tests.utils.general.FileHandling.getVnfRepositoryPath();
         getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
-        AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(getUser());
+        VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
         ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
-        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails, amdocsLicenseMembers, null);
+        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
+            vendorLicenseModel, null);
         resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
         Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
 
@@ -644,9 +648,10 @@
         //Import VSP, create VF - v0.1
         String filePath = org.openecomp.sdc.ci.tests.utils.general.FileHandling.getVnfRepositoryPath();
         getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
-        AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(getUser());
+        VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
         ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
-        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails, amdocsLicenseMembers, null);
+        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
+            vendorLicenseModel, null);
         resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
         Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
 
@@ -796,9 +801,10 @@
         //Import VSP, create VF - v0.1
         String filePath = org.openecomp.sdc.ci.tests.utils.general.FileHandling.getVnfRepositoryPath();
         getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
-        AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(getUser());
+        VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
         ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
-        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails, amdocsLicenseMembers, null);
+        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
+            vendorLicenseModel, null);
         resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
         Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
 
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Service.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Service.java
index 831e811..530c3fb 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Service.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Service.java
@@ -105,7 +105,7 @@
     @Test
     public void createService() throws Exception {
         ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
-        ServiceUIUtils.createService(serviceMetadata, getUser());
+        ServiceUIUtils.createService(serviceMetadata);
     }
 
     @Test
@@ -123,7 +123,7 @@
     public void updateService() throws Exception {
         // Create Service
         ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
-        ServiceUIUtils.createService(serviceMetadata, getUser());
+        ServiceUIUtils.createService(serviceMetadata);
 
         // Update Service
         ServiceGeneralPage.deleteOldTags(serviceMetadata);
@@ -133,7 +133,7 @@
         serviceMetadata.setContactId("cs6543");
         serviceMetadata.getTags().addAll(Arrays.asList("updatedTag", "oneMoreUpdatedTag", "lastOne UpdatedTag"));
         ServiceUIUtils.setServiceCategory(serviceMetadata, ServiceCategoriesEnum.VOIP);
-        ServiceUIUtils.fillServiceGeneralPage(serviceMetadata, getUser());
+        ServiceUIUtils.fillServiceGeneralPage(serviceMetadata);
         GeneralPageElements.clickCreateButton();
 
         ServiceVerificator.verifyServiceUpdatedInUI(serviceMetadata);
@@ -144,7 +144,7 @@
 
         // create service
         ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
-        ServiceUIUtils.createService(serviceMetadata, getUser());
+        ServiceUIUtils.createService(serviceMetadata);
 
         // Delete service
         //GeneralUIUtils.HighlightMyElement(GeneralUIUtils.getWebButton("delete_version"));
@@ -159,7 +159,7 @@
     @Test
     public void checkoutServiceTest() throws Exception {
         ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
-        ServiceUIUtils.createService(serviceMetadata, getUser());
+        ServiceUIUtils.createService(serviceMetadata);
 
         ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
 
@@ -203,7 +203,7 @@
         ResourceGeneralPage.clickCheckinButton(atomicResourceMetaData.getName());
 
         ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
-        ServiceUIUtils.createService(serviceMetadata, getUser());
+        ServiceUIUtils.createService(serviceMetadata);
         DeploymentArtifactPage.getLeftMenu().moveToCompositionScreen();
         CanvasManager canvasManager = CanvasManager.getCanvasManager();
         CompositionPage.searchForElement(atomicResourceMetaData.getName());
@@ -230,7 +230,7 @@
         ResourceGeneralPage.clickCheckinButton(resourceMetaData.getName());
 
         ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
-        ServiceUIUtils.createService(serviceMetadata, getUser());
+        ServiceUIUtils.createService(serviceMetadata);
         DeploymentArtifactPage.getLeftMenu().moveToCompositionScreen();
         CanvasManager canvasManager = CanvasManager.getCanvasManager();
         CompositionPage.searchForElement(resourceMetaData.getName());
@@ -242,7 +242,7 @@
     @Test
     public void addDeploymentArtifactInCompositionScreenTest() throws Exception {
         ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
-        ServiceUIUtils.createService(serviceMetadata, getUser());
+        ServiceUIUtils.createService(serviceMetadata);
 
         ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
         ArtifactInfo artifact = new ArtifactInfo(filePath, HEAT_FILE_YAML_NAME, DESCRIPTION, ARTIFACT_LABEL, "OTHER");
@@ -265,7 +265,7 @@
         List<String> artifactFileNames = new ArrayList<>();
 
         ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
-        ServiceUIUtils.createService(serviceMetadata, getUser());
+        ServiceUIUtils.createService(serviceMetadata);
 
         ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
         ArtifactInfo artifactInfo = new ArtifactInfo(filePath, HEAT_FILE_YAML_NAME, descriptionText, ARTIFACT_LABEL, "OTHER");
@@ -302,7 +302,7 @@
                 descriptionText = DESCRIPTION,
                 url = "http://kuku.com";
         ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
-        ServiceUIUtils.createService(serviceMetadata, getUser());
+        ServiceUIUtils.createService(serviceMetadata);
 
         ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
         new ArtifactInfo(filePath, fileName, descriptionText, ARTIFACT_LABEL, "OTHER");
@@ -326,7 +326,7 @@
                 descriptionTextEdit = "kuku2";
 
         ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
-        ServiceUIUtils.createService(serviceMetadata, getUser());
+        ServiceUIUtils.createService(serviceMetadata);
 
         ServiceGeneralPage.getServiceLeftMenu().moveToManagmentWorkflow();
         ServiceGeneralPage.fillAndAddNewWorkflow(descriptionText, descriptionText);
@@ -339,7 +339,7 @@
     @Test
     public void deleteChangeVersionTest() throws Exception {
         ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
-        ServiceUIUtils.createService(serviceMetadata, getUser());
+        ServiceUIUtils.createService(serviceMetadata);
 
         ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
 
@@ -372,7 +372,7 @@
     public void compositionScreenRightSideButtonsTest() throws Exception {
 
         ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
-        ServiceUIUtils.createService(serviceMetadata, getUser());
+        ServiceUIUtils.createService(serviceMetadata);
 
         ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
 
@@ -529,7 +529,7 @@
         //TODO Andrey should click on certify button
         ResourceGeneralPage.clickCertifyButton(atomicResourceMetaData.getName());
 
-        ServiceUIUtils.createService(serviceMetadata, getUser());
+        ServiceUIUtils.createService(serviceMetadata);
 
         DeploymentArtifactPage.getLeftMenu().moveToCompositionScreen();
         CanvasManager canvasManager = CanvasManager.getCanvasManager();
@@ -551,7 +551,7 @@
     @Test
     public void isDisabledAndReadOnlyInCheckin() throws Exception {
         ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
-        ServiceUIUtils.createService(serviceMetadata, getUser());
+        ServiceUIUtils.createService(serviceMetadata);
         GeneralPageElements.clickCheckinButton(serviceMetadata.getName());
         GeneralUIUtils.findComponentAndClick(serviceMetadata.getName());
 
@@ -578,7 +578,7 @@
         GeneralPageElements.clickCheckinButton(resourceMetaData.getName());
 
         ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
-        ServiceUIUtils.createService(serviceMetadata, getUser());
+        ServiceUIUtils.createService(serviceMetadata);
 
         String selectedInstanceName = addResourceToServiceInCanvas(resourceMetaData);
 
@@ -625,7 +625,7 @@
 
         ResourceGeneralPage.clickCheckinButton(resourceMetaData.getName());
         ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
-        ServiceUIUtils.createService(serviceMetadata, getUser());
+        ServiceUIUtils.createService(serviceMetadata);
         addResourceToServiceInCanvas(resourceMetaData);
         GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
         DeploymentArtifactPage.getLeftMenu().moveToDeploymentViewScreen();
@@ -657,7 +657,7 @@
         ResourceGeneralPage.clickCheckinButton(resourceMetaData.getName());
 
         ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
-        ServiceUIUtils.createService(serviceMetadata, getUser());
+        ServiceUIUtils.createService(serviceMetadata);
 
         addResourceToServiceInCanvas(resourceMetaData);
 
@@ -680,7 +680,7 @@
 		reloginWithNewRole(UserRoleEnum.DESIGNER);*/
 
         ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
-        ServiceUIUtils.createService(serviceMetadata, getUser());
+        ServiceUIUtils.createService(serviceMetadata);
 
         addResourceToServiceInCanvas(resourceMetaData);
 
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/UpgradeServices.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/UpgradeServices.java
index 3023c9b..9fc4cd7 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/UpgradeServices.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/UpgradeServices.java
@@ -25,7 +25,7 @@
 import org.openecomp.sdc.be.model.Resource;
 import org.openecomp.sdc.be.model.Service;
 import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.datatypes.AmdocsLicenseMembers;
+import org.openecomp.sdc.ci.tests.datatypes.VendorLicenseModel;
 import org.openecomp.sdc.ci.tests.datatypes.CanvasElement;
 import org.openecomp.sdc.ci.tests.datatypes.CanvasManager;
 import org.openecomp.sdc.ci.tests.datatypes.ConnectionWizardPopUpObject;
@@ -427,9 +427,10 @@
     private Resource createAndCertifyVFfromVSP(String vnfFile) throws Exception {
         String filePath = FileHandling.getPortMirroringRepositoryPath();
         getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
-        AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(getUser());
+        VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
         ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
-        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails, amdocsLicenseMembers, null);
+        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
+            vendorLicenseModel, null);
         resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
         Resource vfResource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
         vfResource = (Resource) AtomicOperationUtils.changeComponentState(vfResource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/VFCArtifacts.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/VFCArtifacts.java
index d0ca864..56b6fb7 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/VFCArtifacts.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/VFCArtifacts.java
@@ -23,7 +23,7 @@
 import com.aventstack.extentreports.Status;
 import org.apache.http.HttpStatus;
 import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.ci.tests.datatypes.AmdocsLicenseMembers;
+import org.openecomp.sdc.ci.tests.datatypes.VendorLicenseModel;
 import org.openecomp.sdc.ci.tests.datatypes.HeatMetaFirstLevelDefinition;
 import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
 import org.openecomp.sdc.ci.tests.datatypes.VendorSoftwareProductObject;
@@ -218,8 +218,9 @@
         String vnfFile = "2016-043_vsaegw_fdnt_30_1607_e2e.zip";
         String snmpFile = "Fault-alarms-ASDC-vprobes-vLB.zip";
 
-        AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(getUser());
-        VendorSoftwareProductObject createVSP = VendorSoftwareProductRestUtils.createVSP(resourceMetaData, vnfFile, filePath, getUser(), amdocsLicenseMembers);
+        VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
+        VendorSoftwareProductObject createVSP = VendorSoftwareProductRestUtils.createVSP(resourceMetaData, vnfFile, filePath, getUser(),
+            vendorLicenseModel);
         String vspName = createVSP.getName();
         resourceMetaData.setName(vspName);
 //		VendorSoftwareProductObject resourceMeta = createVSP.right;
@@ -252,8 +253,9 @@
         String snmpPollFile = "vprobes-vLB.zip";
         String updatedSnmpPollFile = "vprobes-vLBAgent.zip";
 
-        AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(getUser());
-        VendorSoftwareProductObject createVSP = VendorSoftwareProductRestUtils.createVSP(resourceMetaData, vnfFile, filePath, getUser(), amdocsLicenseMembers);
+        VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
+        VendorSoftwareProductObject createVSP = VendorSoftwareProductRestUtils.createVSP(resourceMetaData, vnfFile, filePath, getUser(),
+            vendorLicenseModel);
         String vspName = createVSP.getName();
         resourceMetaData.setName(vspName);
         String vspid = createVSP.getVspId();
@@ -291,8 +293,9 @@
         String snmpFile = "vprobes-vLB.zip";
         String updatedSnmpFile = "vprobes-vLB-Modified.zip";
 
-        AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(getUser());
-        VendorSoftwareProductObject createVSP = VendorSoftwareProductRestUtils.createVSP(resourceMetaData, vnfFile, filePath, getUser(), amdocsLicenseMembers);
+        VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
+        VendorSoftwareProductObject createVSP = VendorSoftwareProductRestUtils.createVSP(resourceMetaData, vnfFile, filePath, getUser(),
+            vendorLicenseModel);
         String vspName = createVSP.getName();
         resourceMetaData.setName(vspName);
         String vspid = createVSP.getVspId();
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Vf.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Vf.java
index 859d628..1a5cace 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Vf.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Vf.java
@@ -20,7 +20,13 @@
 
 package org.openecomp.sdc.ci.tests.execute.sanity;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
 import com.aventstack.extentreports.Status;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
 import org.openecomp.sdc.be.dao.api.ActionStatus;
 import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
 import org.openecomp.sdc.be.model.LifecycleStateEnum;
@@ -40,6 +46,7 @@
 import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum;
 import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
 import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions;
 import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
 import org.openecomp.sdc.ci.tests.pages.CompositionPage;
 import org.openecomp.sdc.ci.tests.pages.DeploymentArtifactPage;
@@ -62,18 +69,17 @@
 import org.openecomp.sdc.ci.tests.verificator.VfVerificator;
 import org.openqa.selenium.By;
 import org.openqa.selenium.WebElement;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.testng.AssertJUnit;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-
 public class Vf extends SetupCDTest {
 
+    private static final Logger LOGGER = LoggerFactory.getLogger(Vf.class);
+
     private String filePath;
 
     @BeforeClass
@@ -420,22 +426,24 @@
     }
 
     @Test
-    public void changeInstanceNameInVfTest() throws Exception {
-        ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
-        ResourceUIUtils.createVF(vfMetaData, getUser());
-
-        ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
-        CanvasManager vfCanvasManager = CanvasManager.getCanvasManager();
-        CanvasElement computeElement = vfCanvasManager.createElementOnCanvas(LeftPanelCanvasItems.COMPUTE);
-
-        String updatedInstanceName = "updatedName";
-        vfCanvasManager.updateElementNameInCanvas(computeElement, updatedInstanceName);
-
-        String actualSelectedInstanceName = CompositionPage.getSelectedInstanceName();
-        AssertJUnit.assertTrue(updatedInstanceName.equals(actualSelectedInstanceName));
+    public void changeInstanceNameInVfTest() {
+        final ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
+        final String updatedInstanceName = "updatedName";
+        try {
+            ResourceUIUtils.createVF(vfMetaData, getUser());
+            ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
+            final CanvasManager vfCanvasManager = CanvasManager.getCanvasManager();
+            final CanvasElement computeElement = vfCanvasManager.createElementOnCanvas(LeftPanelCanvasItems.COMPUTE);
+            vfCanvasManager.updateElementNameInCanvas(computeElement, updatedInstanceName);
+        } catch (final Exception e) {
+            final String errorMsg = "An unexpected error has occurred during the changeInstanceNameInVfTest";
+            takeScreenshot("ChangeInstanceNameInVf" + vfMetaData.getToscaResourceName(), errorMsg);
+            LOGGER.error(errorMsg, e);
+            fail(errorMsg);
+        }
+        assertEquals(CompositionPage.getSelectedInstanceName(), updatedInstanceName);
     }
 
-
     @Test
     public void submitVfForTestingWithNonCertifiedAsset() throws Exception {
         String fileName = "vFW_VFC4.yml";
@@ -535,6 +543,13 @@
         AssertJUnit.assertEquals(expectedHeaderAndRowSize, rows.size());
     }
 
+    private void takeScreenshot(final String screenshotName, final String errorMsg) {
+        try {
+            ExtentTestActions.addScreenshot(Status.ERROR, screenshotName, errorMsg);
+        } catch (final IOException e) {
+            LOGGER.warn("Could not take screenshot", e);
+        }
+    }
 
     @Override
     protected UserRoleEnum getRole() {
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/DriverFactory.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/DriverFactory.java
index 7ba689c..8cfe5bd 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/DriverFactory.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/DriverFactory.java
@@ -83,7 +83,7 @@
         };
     }
 
-    public static WebDriver getDriver() throws Exception {
+    public static WebDriver getDriver() {
         return driverThread.get().getDriver();
     }
 
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ExtentTestActions.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ExtentTestActions.java
index 9ebcb9b..c3a1d13 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ExtentTestActions.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ExtentTestActions.java
@@ -35,7 +35,11 @@
 
 public class ExtentTestActions {
 
-    private static SomeInterface testManager = new ExtentTestManager();
+    private static final SomeInterface testManager = ExtentTestManager.getInstance();
+
+    private ExtentTestActions() {
+
+    }
 
     public static void log(Status logStatus, Markup mark) {
         ExtentTest test = testManager.getTest();
@@ -80,20 +84,15 @@
         }
     }
 
-    public static String addScreenshot(Status logStatus, String screenshotName, String message) throws IOException {
-        String imageFilePath = null;
-        String uuid = UUID.randomUUID().toString();
-        String[] stringArray = uuid.split("-");
-        screenshotName = screenshotName + "-" + stringArray[stringArray.length - 1];
-        try {
-            File imageFile = GeneralUIUtils.takeScreenshot(screenshotName, SetupCDTest.getScreenshotFolder());
-            imageFilePath = new File(SetupCDTest.getReportFolder()).toURI().relativize(imageFile.toURI()).getPath();
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-
-        ExtentTest test = testManager.getTest();
-        test.log(logStatus, message, MediaEntityBuilder.createScreenCaptureFromPath(imageFilePath).build());
+    public static String addScreenshot(final Status logStatus, String screenshotName,
+                                       final String message) throws IOException {
+        final String[] splitUuid = UUID.randomUUID().toString().split("-");
+        screenshotName = screenshotName + "-" + splitUuid[splitUuid.length - 1];
+        final File imageFile = GeneralUIUtils.takeScreenshot(screenshotName, SetupCDTest.getScreenshotFolder());
+        final String imageFilePath = new File(SetupCDTest.getReportFolder()).toURI().relativize(imageFile.toURI())
+            .getPath();
+        testManager.getTest()
+            .log(logStatus, message, MediaEntityBuilder.createScreenCaptureFromPath(imageFilePath).build());
         return imageFilePath;
     }
 
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ExtentTestManager.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ExtentTestManager.java
index 295abbe..1effea9 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ExtentTestManager.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ExtentTestManager.java
@@ -22,44 +22,48 @@
 
 import com.aventstack.extentreports.ExtentReports;
 import com.aventstack.extentreports.ExtentTest;
-import org.openecomp.sdc.ci.tests.api.SomeInterface;
-
 import java.util.HashMap;
+import org.openecomp.sdc.ci.tests.api.SomeInterface;
 
 public class ExtentTestManager implements SomeInterface {
 
-    private static HashMap<Long, ExtentTest> extentTestMap = new HashMap<Long, ExtentTest>();
-    private static ExtentReports extent = ExtentManager.getReporter();
+    private final HashMap<Long, ExtentTest> extentTestByThreadIdMap = new HashMap<>();
+    private final ExtentReports extent = ExtentManager.getReporter();
+    private static final ExtentTestManager INSTANCE = new ExtentTestManager();
 
-    public ExtentTestManager() {
+    private ExtentTestManager() {
 
     }
 
+    public static ExtentTestManager getInstance() {
+        return INSTANCE;
+    }
+
     @Override
     public synchronized ExtentTest getTest() {
-        return extentTestMap.get(Thread.currentThread().getId());
+        return extentTestByThreadIdMap.get(Thread.currentThread().getId());
     }
 
-    public static synchronized void endTest() {
+    public synchronized void endTest() {
         extent.flush();
     }
 
-    public static synchronized ExtentTest startTest(String testName) {
+    public synchronized ExtentTest startTest(final String testName) {
         return startTest(testName, "");
     }
 
-    public static synchronized ExtentTest startTest(String testName, String desc) {
-        ExtentTest test = extent.createTest(testName, desc);
-        extentTestMap.put(Thread.currentThread().getId(), test);
+    public synchronized ExtentTest startTest(final String testName, final String desc) {
+        final ExtentTest test = extent.createTest(testName, desc);
+        extentTestByThreadIdMap.put(Thread.currentThread().getId(), test);
 
         return test;
     }
 
-    public static synchronized <T> void assignCategory(Class<T> clazz) {
+    public synchronized <T> void assignCategory(Class<T> clazz) {
         String[] parts = clazz.getName().split("\\.");
         String lastOne1 = parts[parts.length - 1];
         String lastOne2 = parts[parts.length - 2];
-        extentTestMap.get(Thread.currentThread().getId()).assignCategory(lastOne2 + "-" + lastOne1);
+        extentTestByThreadIdMap.get(Thread.currentThread().getId()).assignCategory(lastOne2 + "-" + lastOne1);
     }
 }
 
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ReportAfterTestManager.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ReportAfterTestManager.java
index fcbbaef..50b6daf 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ReportAfterTestManager.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ReportAfterTestManager.java
@@ -20,99 +20,43 @@
 
 package org.openecomp.sdc.ci.tests.execute.setup;
 
+import static org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions.addScreenshot;
+import static org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions.addTag;
+import static org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions.log;
+
 import com.aventstack.extentreports.Status;
+import java.io.IOException;
+import org.apache.commons.lang3.StringUtils;
 import org.openecomp.sdc.ci.tests.execute.setup.ExtentManager.suiteNameXml;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.testng.ITestContext;
 import org.testng.ITestResult;
 
-import java.io.IOException;
+public class ReportAfterTestManager {
 
-public class ReportAfterTestManager extends ExtentTestActions {
-
+    private static final Logger LOGGER = LoggerFactory.getLogger(ReportAfterTestManager.class);
     private static String testName;
     private static Throwable throwable;
-    private static int status;
+    private static String exceptionMsgFormat = "%s - The following exception occurred:";
 
-    private static void logSuccessAfterTest() {
-        final Status logStatus = Status.PASS;
-        addTag(logStatus, "Success");
-        try {
-            String message = "Finished the test with the following screenshot : ";
-            addScreenshotToReport(logStatus, testName, message);
-        } catch (Exception e) {
-            log(logStatus, "SUCCESS - The following exepction occured : " + e.getMessage());
-        }
+    private ReportAfterTestManager() {
+
     }
 
-    private static void logFailAfterTest() {
-        addTag(Status.FAIL, "Failure");
-        try {
-            log(Status.ERROR, "ERROR - The following exepction occured : ");
-            log(Status.ERROR, throwable);
-            String message = "Failure is described in the following screenshot : ";
-            addScreenshotToReport(Status.FAIL, testName, message);
-        } catch (Exception e) {
-            log(Status.ERROR, "ERROR - The following exepction occured : " + e.getMessage());
-        }
-    }
-
-    private static void logSkipAfterTest() {
-        final Status logStatus = Status.SKIP;
-        addTag(logStatus, "Skipped");
-        try {
-            log(logStatus, "SKIP - The following exepction occured : ");
-            log(logStatus, throwable);
-            String message = "Skip is described in the following screenshot : ";
-            addScreenshotToReport(logStatus, testName, message);
-        } catch (Exception e) {
-            log(logStatus, "SKIP - The following exepction occured : " + e.getMessage());
-        }
-    }
-
-    private static void logFatalAfterTest() {
-        final Status logStatus = Status.FATAL;
-        addTag(logStatus, "Fatal");
-        try {
-            log(logStatus, "FATAL - The following exepction occured : ");
-            log(logStatus, throwable);
-            String message = "Fatal is described in the following screenshot : ";
-            addScreenshotToReport(logStatus, testName, message);
-        } catch (Exception e) {
-            log(logStatus, "FATAL - The following exepction occured : " + e.getMessage());
-        }
-    }
-
-    private static String addScreenshotToReport(Status logStatus, String testName, String message) throws IOException {
-
-        String addedValueFromDataProvider = WindowTestManager.getWindowMap().getAddedValueFromDataProvider();
-        if (addedValueFromDataProvider != null) {
-            addedValueFromDataProvider = addedValueFromDataProvider.replace(":", "-");
-            testName = testName + "...." + addedValueFromDataProvider;
-        }
-
-        return addScreenshot(logStatus, testName, message);
-    }
-
-    public static void report(ITestResult result, ITestContext context) {
-
+    public static void report(final ITestResult result, final ITestContext context) {
         testName = result.getName();
         throwable = result.getThrowable();
-        status = result.getStatus();
 
-        String suiteName = ExtentManager.getSuiteName(context);
+        final String suiteName = ExtentManager.getSuiteName(context);
 
-        switch (status) {
+        switch (result.getStatus()) {
             case ITestResult.SUCCESS:
                 logSuccessAfterTest();
                 break;
 
             case ITestResult.FAILURE:
-
-                if (suiteName.equals(suiteNameXml.TESTNG_FAILED_XML_NAME.getValue())) {
-                    logFatalAfterTest();
-                } else {
-                    logFailAfterTest();
-                }
+                logFailure(suiteName);
                 break;
 
             case ITestResult.SKIP:
@@ -125,5 +69,55 @@
 
     }
 
+    private static void logSuccessAfterTest() {
+        addTag(Status.PASS, "Success");
+        takeScreenshot(Status.PASS);
+    }
+
+    private static void logFailAfterTest() {
+        addTag(Status.FAIL, "Failure");
+        log(Status.ERROR, String.format(exceptionMsgFormat, Status.ERROR));
+        log(Status.ERROR, throwable);
+        takeScreenshot(Status.FAIL);
+    }
+
+    private static void logSkipAfterTest() {
+        addTag(Status.SKIP, "Skipped");
+        log(Status.SKIP, String.format(exceptionMsgFormat, Status.SKIP));
+        log(Status.SKIP, throwable);
+        takeScreenshot(Status.SKIP);
+    }
+
+    private static void logFatalAfterTest() {
+        addTag(Status.FATAL, "Fatal");
+        log(Status.FATAL, String.format(exceptionMsgFormat, Status.FATAL));
+        log(Status.FATAL, throwable);
+        takeScreenshot(Status.FATAL);
+    }
+
+    private static void takeScreenshot(final Status status) {
+        String adjustedTestName = testName;
+        String infoFromDataProvider = WindowTestManager.getWindowMap().getAddedValueFromDataProvider();
+        if (StringUtils.isNotEmpty(infoFromDataProvider)) {
+            infoFromDataProvider = infoFromDataProvider.replace(":", "-");
+            adjustedTestName = String.format("%s | %s", testName, infoFromDataProvider);
+        }
+        try {
+            addScreenshot(status, adjustedTestName, "Finished the test with the following screenshot:");
+        } catch (final IOException e) {
+            final String warnMsg = "Could not take screenshot of the final screen";
+            LOGGER.warn(warnMsg, e);
+            log(Status.WARNING, String.format("%s: %s", warnMsg, e.getMessage()));
+        }
+    }
+
+    private static void logFailure(final String suiteName) {
+        if (suiteNameXml.TESTNG_FAILED_XML_NAME.getValue().equals(suiteName)) {
+            logFatalAfterTest();
+        } else {
+            logFailAfterTest();
+        }
+    }
+
 }
 
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/SetupCDTest.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/SetupCDTest.java
index ad2071a..a700a0d 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/SetupCDTest.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/SetupCDTest.java
@@ -27,12 +27,11 @@
 import net.lightbody.bmp.core.har.Har;
 import org.json.simple.JSONObject;
 import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.api.SomeInterface;
 import org.openecomp.sdc.ci.tests.config.UserCredentialsFromFile;
 import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
 import org.openecomp.sdc.ci.tests.datatypes.UserCredentials;
 import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.execute.sanity.OnboardingFlowsUI;
+import org.openecomp.sdc.ci.tests.execute.sanity.OnboardingFlowsUi;
 import org.openecomp.sdc.ci.tests.execute.setup.ExtentManager.suiteNameXml;
 import org.openecomp.sdc.ci.tests.pages.HomePage;
 import org.openecomp.sdc.ci.tests.run.StartTest;
@@ -46,6 +45,7 @@
 import org.openqa.selenium.WebElement;
 import org.openqa.selenium.support.ui.ExpectedConditions;
 import org.openqa.selenium.support.ui.WebDriverWait;
+import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.testng.Assert;
 import org.testng.ITestContext;
@@ -66,45 +66,43 @@
 
 public abstract class SetupCDTest extends DriverFactory {
 
-    //	private static final String RE_RUN = "ReRun - ";
+    private static final Logger LOGGER = LoggerFactory.getLogger(SetupCDTest.class);
+
     private static final String RE_RUN = "<html><font color=\"red\">ReRun - </font></html>";
     private static final String WEB_SEAL_PASSWORD = "123123a";
     protected static final String HEAT_FILE_YAML_NAME_PREFIX = "Heat-File";
     protected static final String HEAT_FILE_YAML_NAME_SUFFIX = ".yaml";
     private static final int BASIC_SLEEP_DURATION = 1000;
 
-    public SetupCDTest() {
-        LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
-        lc.getLogger("org.apache").setLevel(Level.INFO);
-    }
-
     /**************** CONSTANTS ****************/
     private static final String CREDENTIALS_FILE = "credentials.yaml";
+
     private static final String REPORT_FILE_NAME = "SDC_UI_Extent_Report.html";
     private static final String REPORT_FOLDER = "." + File.separator + "ExtentReport" + File.separator;
     private static final String SCREENSHOT_FOLDER = REPORT_FOLDER + "screenshots" + File.separator;
     private static final String HAR_FILES_FOLDER_NAME = "har_files";
     private static final String HAR_FILES_FOLDER = REPORT_FOLDER + HAR_FILES_FOLDER_NAME + File.separator;
 
-
     private static final String SHORT_CSV_REPORT_FILE_NAME = "ShortReport.csv";
-    private static final int NUM_OF_ATTEMPTS_TO_REFTRESH = 2;
 
+    private static final int NUM_OF_ATTEMPTS_TO_REFTRESH = 2;
 
     /**************** PRIVATES ****************/
     private static String url;
+
     private static boolean uiSimulator;
     private static boolean localEnv = true;
     private static OnboardCSVReport csvReport;
     private final UserCredentialsFromFile credentialsIns = UserCredentialsFromFile.getInstance();
-
     private static ITestContext myContext;
 
+    public SetupCDTest() {
+        LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
+        lc.getLogger("org.apache").setLevel(Level.INFO);
+    }
 
-    /**************** METHODS ****************/
     public static ExtentTest getExtendTest() {
-        SomeInterface testManager = new ExtentTestManager();
-        return testManager.getTest();
+        return ExtentTestManager.getInstance().getTest();
     }
 
     public static WindowTest getWindowTest() {
@@ -162,12 +160,12 @@
             System.out.println("ExtentReport instance started from BeforeMethod...");
             String suiteName = ExtentManager.getSuiteName(context);
             if (suiteName.equals(suiteNameXml.TESTNG_FAILED_XML_NAME.getValue())) {
-                ExtentTestManager.startTest(RE_RUN + method.getName());
+                ExtentTestManager.getInstance().startTest(RE_RUN + method.getName());
             } else {
-                ExtentTestManager.startTest(method.getName());
+                ExtentTestManager.getInstance().startTest(method.getName());
             }
 
-            ExtentTestManager.assignCategory(this.getClass());
+            ExtentTestManager.getInstance().assignCategory(this.getClass());
             setBrowserBeforeTest(getRole());
         } else {
             System.out.println("ExtentReport instance started from Test...");
@@ -186,8 +184,7 @@
 
     /**************** AFTER ****************/
     @AfterMethod(alwaysRun = true)
-    public void quitAfterTest(ITestResult result, ITestContext context) throws Exception {
-
+    public void quitAfterTest(final ITestResult result, final ITestContext context) throws Exception {
         try {
             ReportAfterTestManager.report(result, context);
             GeneralUIUtils.closeErrorMessage();
@@ -197,35 +194,36 @@
                     addTrafficFileToReport(result);
                 }
 
-                if (result.getInstanceName().equals(OnboardingFlowsUI.class.getName()) && result.getStatus() == ITestResult.FAILURE) {
-                    System.out.println("Onboarding test failed, closign browser....");
-                    getExtendTest().log(Status.INFO, "Onboarding test failed, closing browser....");
+                if (result.getInstanceName().equals(OnboardingFlowsUi.class.getName()) && result.getStatus() == ITestResult.FAILURE) {
+                    final String msg = "Onboarding test failed, closing browser";
+                    LOGGER.info(msg);
+                    getExtendTest().log(Status.INFO, msg);
                     quitDriver();
                 } else if (!getUser().getRole().toLowerCase().equals(UserRoleEnum.ADMIN.name().toLowerCase())) {
                     boolean navigateToHomePageSuccess = HomePage.navigateToHomePage();
                     if (!navigateToHomePageSuccess) {
-                        System.out.println("Navigating to homepage failed, reopening driver....");
-                        getExtendTest().log(Status.INFO, "Navigating to homepage failed, reopening driver....");
+                        final String msg = "Navigating to homepage failed, reopening driver";
+                        LOGGER.info(msg);
+                        getExtendTest().log(Status.INFO, msg);
                         quitDriver();
                     }
                 }
 
-            } catch (Exception e) {
-                e.printStackTrace();
+            } catch (final Exception e) {
+                LOGGER.error("An unexpected error has occurred", e);
                 getExtendTest().log(Status.ERROR, "Exception:" + e.toString());
             }
 
 
-            ExtentTestManager.endTest();
-            String suiteName = ExtentManager.getSuiteName(context);
+            ExtentTestManager.getInstance().endTest();
+            final String suiteName = ExtentManager.getSuiteName(context);
 //			write result to csv file
-            if ((!suiteName.equals(suiteNameXml.TESTNG_FAILED_XML_NAME.getValue())) && (result.getStatus() == ITestResult.SKIP)) {
+            if ((!suiteNameXml.TESTNG_FAILED_XML_NAME.getValue().equals(suiteName)) && (result.getStatus() == ITestResult.SKIP)) {
                 addResultToCSV(result, context);
             }
-            if (suiteName.equals(suiteNameXml.TESTNG_FAILED_XML_NAME.getValue()) && !(result.getStatus() == ITestResult.SUCCESS)) {
+            if (suiteNameXml.TESTNG_FAILED_XML_NAME.getValue().equals(suiteName) && !(result.getStatus() == ITestResult.SUCCESS)) {
                 addResultToCSV(result, context);
             }
-//	    	ExtentManager.closeReporter();
             FileHandling.cleanCurrentDownloadDir();
         }
 
@@ -240,11 +238,11 @@
     }
 
     private void generateReport4Jenkins(ITestContext context) {
-        String suiteName = ExtentManager.getSuiteName(context);
-        JSONObject obj = new JSONObject();
-        String success = Integer.toString(context.getPassedTests().size());
-        String failed = Integer.toString(context.getFailedTests().size());
-        String total = Integer.toString(context.getFailedTests().size() + context.getPassedTests().size());
+        final String suiteName = ExtentManager.getSuiteName(context);
+        final JSONObject obj = new JSONObject();
+        final String success = Integer.toString(context.getPassedTests().size());
+        final String failed = Integer.toString(context.getFailedTests().size());
+        final String total = Integer.toString(context.getFailedTests().size() + context.getPassedTests().size());
         obj.put("projectName", "SDC-ONAP-UI-Automation-" + suiteName);
         obj.put("projectVersion", AutomationUtils.getOSVersion());
         obj.put("platform", "Linux");
@@ -253,17 +251,13 @@
         obj.put("failed", failed);
 
         try (FileWriter file = new FileWriter(getReportFolder() + "jenkinsResults.json")) {
-
             file.write(obj.toJSONString());
             file.flush();
-
-        } catch (IOException e) {
-            e.printStackTrace();
+        } catch (final IOException e) {
+            LOGGER.debug("An error has occurred while writing 'jenkinsResults.json' file", e);
         }
 
-        System.out.print(obj);
-
-
+        LOGGER.debug(obj.toJSONString());
     }
 
 
@@ -299,23 +293,20 @@
     }
 
 
-    private static void navigateToUrl(String url) throws Exception {
+    private static void navigateToUrl(final String url) {
         try {
-            System.out.println("Deleting cookies...");
+            LOGGER.info("Deleting cookies");
             deleteCookies();
-
-            System.out.println("Navigating to URL : " + url);
+            LOGGER.info("Navigating to URL : " + url);
             getDriver().navigate().to(url);
             GeneralUIUtils.waitForLoader();
-
-            System.out.println("Zooming out...");
+            LOGGER.info("Zooming out");
             GeneralUIUtils.windowZoomOutUltimate();
-
         } catch (Exception e) {
-            String msg = "Browser is unreachable";
-            System.out.println(msg);
-            getExtendTest().log(Status.ERROR, msg);
-            Assert.fail(msg);
+            final String errorMsg = String.format("Could not navigate to '%s'", url);
+            LOGGER.error(errorMsg, e);
+            getExtendTest().log(Status.ERROR, errorMsg);
+            Assert.fail(errorMsg);
         }
     }
 
@@ -415,12 +406,16 @@
         passwordTextbox.sendKeys(userId.getPassword());
     }
 
-    private void loginWithUser(UserRoleEnum role) {
+    private void loginWithUser(final UserRoleEnum role) {
         try {
-            getExtendTest().log(Status.INFO, String.format("Login as user %s", role.name().toUpperCase()));
+            final String msg = String
+                .format("Login as user '%s', role '%s'", role.getUserId(), role.getUserRole());
+            getExtendTest().log(Status.INFO, msg);
+            LOGGER.info(msg);
             loginToSystem(role);
+            LOGGER.debug("Going to home page");
             goToHomePage(role);
-        } catch (Exception e) {
+        } catch (final Exception e) {
             throw new RuntimeException(e);
         } finally {
             getWindowTest().setPreviousRole(getWindowTest().getUser().getRole());
@@ -441,21 +436,17 @@
         return getWindowTest().getUser();
     }
 
-    private void setBrowserBeforeTest(UserRoleEnum role) {
-        System.out.println(String.format("Setup before test as %s.", role.toString().toUpperCase()));
-        try {
-            System.out.println("Previous role is : " + getWindowTest().getPreviousRole() + " ; Current role is : " + role.name());
-            if (!getWindowTest().getPreviousRole().toLowerCase().equals(role.name().toLowerCase())) {
-                System.out.println("Roles are different, navigate and login");
-                navigateAndLogin(role);
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
+    private void setBrowserBeforeTest(final UserRoleEnum role) {
+        LOGGER.info(String.format("Setup before test for role '%s'", role.name()));
+        if (!getWindowTest().getPreviousRole().equalsIgnoreCase(role.name())) {
+            LOGGER.info(String.format("Logging in with new role '%s'. Previous role was: '%s'.", role.name(),
+                getWindowTest().getPreviousRole()));
+            navigateAndLogin(role);
         }
     }
 
-    private void navigateAndLogin(UserRoleEnum role) throws Exception {
-        getWindowTest().setRefreshAttempts(getWindowTest().getRefreshAttempts() != 0 ? getWindowTest().getRefreshAttempts() : 0);
+    private void navigateAndLogin(final UserRoleEnum role) {
+        getWindowTest().setRefreshAttempts(getWindowTest().getRefreshAttempts());
         setUser(role);
         navigateToUrl(url);
         loginWithUser(role);
@@ -471,8 +462,7 @@
         return user;
     }
 
-    protected void reloginWithNewRole(UserRoleEnum role) throws Exception {
-        System.out.println(String.format("Setup before relogin as %s", role.toString().toUpperCase()));
+    protected void reloginWithNewRole(final UserRoleEnum role) {
         navigateAndLogin(role);
     }
 
@@ -500,15 +490,15 @@
     public void setLog(String fromDataProvider) {
 
         String suiteName = ExtentManager.getSuiteName(myContext);
-        if (suiteName.equals(suiteNameXml.TESTNG_FAILED_XML_NAME.getValue())) {
-            ExtentTestManager.startTest(RE_RUN + Thread.currentThread().getStackTrace()[2].getMethodName() + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + fromDataProvider);
+        if (suiteNameXml.TESTNG_FAILED_XML_NAME.getValue().equals(suiteName)) {
+            ExtentTestManager.getInstance().startTest(RE_RUN + Thread.currentThread().getStackTrace()[2].getMethodName() + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + fromDataProvider);
         } else {
-            ExtentTestManager.startTest(Thread.currentThread().getStackTrace()[2].getMethodName() + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + fromDataProvider);
+            ExtentTestManager.getInstance().startTest(Thread.currentThread().getStackTrace()[2].getMethodName() + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + fromDataProvider);
         }
 
 
         getWindowTest().setAddedValueFromDataProvider(fromDataProvider);
-        ExtentTestManager.assignCategory(this.getClass());
+        ExtentTestManager.getInstance().assignCategory(this.getClass());
         setBrowserBeforeTest(getRole());
     }
 
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/WebDriverThread.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/WebDriverThread.java
index bc9fd7e..8fdad16 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/WebDriverThread.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/WebDriverThread.java
@@ -24,6 +24,7 @@
 import net.lightbody.bmp.client.ClientUtil;
 import net.lightbody.bmp.proxy.CaptureType;
 import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.exception.WebDriverThreadRuntimeException;
 import org.openecomp.sdc.ci.tests.utilities.FileHandling;
 import org.openqa.selenium.Platform;
 import org.openqa.selenium.UnexpectedAlertBehaviour;
@@ -39,11 +40,13 @@
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.UUID;
-
-//import org.openqa.selenium.firefox.FirefoxOptions; // Selenium 3.4.0 change
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class WebDriverThread {
 
+    private final static Logger LOGGER = LoggerFactory.getLogger(SetupCDTest.class);
+
     static final String AUTOMATION_DOWNLOAD_DIR = "automationDownloadDir";
     private WebDriver webdriver;
     private FirefoxProfile firefoxProfile;
@@ -54,7 +57,7 @@
         webdriver.manage().window().maximize();
     }
 
-    public WebDriver getDriver() throws Exception {
+    public WebDriver getDriver() {
         return webdriver;
     }
 
@@ -66,49 +69,45 @@
     }
 
 
-    private void initDriver(Config config) {
-        try {
-            boolean remoteTesting = config.isRemoteTesting();
-            if (!remoteTesting) {
-                boolean mobProxyStatus = config.getUseBrowserMobProxy();
-                if (mobProxyStatus) {
-                    setWebDriverWithMobProxy();
-                } else {
+    private void initDriver(final Config config) {
+        if (config.isRemoteTesting()) {
+            LOGGER.info("Opening REMOTE browser");
+            final String remoteEnvIP = config.getRemoteTestingMachineIP();
+            final String remoteEnvPort = config.getRemoteTestingMachinePort();
 
-                    System.out.println("Opening LOCAL browser");
-                    DesiredCapabilities cap = new DesiredCapabilities();
+            final DesiredCapabilities cap = DesiredCapabilities.firefox();
+            cap.setPlatform(Platform.ANY);
+            cap.setBrowserName("firefox");
 
-                    cap = DesiredCapabilities.firefox();
-                    cap.setBrowserName("firefox");
-                    cap.setCapability(FirefoxDriver.PROFILE, initFirefoxProfile());
-                    //unexpected model dialog fix.
-                    cap.setCapability(CapabilityType.UNEXPECTED_ALERT_BEHAVIOUR, UnexpectedAlertBehaviour.ACCEPT);
-
-                    firefoxProfile.setPreference("network.proxy.type", 2);
-                    firefoxProfile.setPreference("network.proxy.autoconfig_url", "http://autoproxy.sbc.com/autoproxy.cgi");
-                    firefoxProfile.setPreference("network.proxy.no_proxies_on", "localhost");
-
-                    webdriver = new FirefoxDriver(cap);
-                }
-            } else {
-                System.out.println("Opening REMOTE browser");
-                String remoteEnvIP = config.getRemoteTestingMachineIP();
-                String remoteEnvPort = config.getRemoteTestingMachinePort();
-
-                DesiredCapabilities cap = new DesiredCapabilities();
-                cap = DesiredCapabilities.firefox();
-                cap.setPlatform(Platform.ANY);
-                cap.setBrowserName("firefox");
-
-                String remoteNodeUrl = String.format(SELENIUM_NODE_URL, remoteEnvIP, remoteEnvPort);
-                RemoteWebDriver remoteWebDriver = new RemoteWebDriver(new URL(remoteNodeUrl), cap);
-                remoteWebDriver.setFileDetector(new LocalFileDetector());
-                webdriver = remoteWebDriver;
+            final String remoteUrlString = String.format(SELENIUM_NODE_URL, remoteEnvIP, remoteEnvPort);
+            final URL remoteUrl;
+            try {
+                remoteUrl = new URL(remoteUrlString);
+            } catch (MalformedURLException e) {
+                throw new WebDriverThreadRuntimeException(String.format("Malformed URL '%s'", remoteUrlString), e);
+            }
+            final RemoteWebDriver remoteWebDriver = new RemoteWebDriver(remoteUrl, cap);
+            remoteWebDriver.setFileDetector(new LocalFileDetector());
+            webdriver = remoteWebDriver;
+        } else {
+            if (config.getUseBrowserMobProxy()) {
+                setWebDriverWithMobProxy();
+                return;
             }
 
+            LOGGER.info("Opening LOCAL browser");
 
-        } catch (MalformedURLException e) {
-            throw new RuntimeException(e);
+            final DesiredCapabilities cap = DesiredCapabilities.firefox();
+            cap.setBrowserName("firefox");
+            cap.setCapability(FirefoxDriver.PROFILE, initFirefoxProfile());
+            //unexpected model dialog fix.
+            cap.setCapability(CapabilityType.UNEXPECTED_ALERT_BEHAVIOUR, UnexpectedAlertBehaviour.ACCEPT);
+
+            firefoxProfile.setPreference("network.proxy.type", 2);
+            firefoxProfile.setPreference("network.proxy.autoconfig_url", "http://autoproxy.sbc.com/autoproxy.cgi");
+            firefoxProfile.setPreference("network.proxy.no_proxies_on", "localhost");
+
+            webdriver = new FirefoxDriver(cap);
         }
     }
 
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/GeneralPageElements.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/GeneralPageElements.java
index d4051d7..611c24a 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/GeneralPageElements.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/GeneralPageElements.java
@@ -40,7 +40,7 @@
     private static final int WAIT_FOR_ELEMENT_TIME_OUT_DIVIDER = 10;
 
     protected GeneralPageElements() {
-        super();
+
     }
 
     public static ResourceLeftMenu getLeftMenu() {
@@ -229,13 +229,13 @@
         GeneralUIUtils.ultimateWait();
     }
 
-    public static List<WebElement> getElemenetsFromTable() {
+    public static List<WebElement> getElementsFromTable() {
         GeneralUIUtils.ultimateWait();
-        return GeneralUIUtils.getElemenetsFromTable(By.className("flex-container"));
+        return GeneralUIUtils.getElementsByLocator(By.className("flex-container"));
     }
 
     public static boolean checkElementsCountInTable(int expectedElementsCount) {
-        return checkElementsCountInTable(expectedElementsCount, () -> getElemenetsFromTable());
+        return checkElementsCountInTable(expectedElementsCount, () -> getElementsFromTable());
     }
 
 
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/GovernorOperationPage.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/GovernorOperationPage.java
index 72f5bc7..5ffd6c8 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/GovernorOperationPage.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/GovernorOperationPage.java
@@ -21,23 +21,41 @@
 package org.openecomp.sdc.ci.tests.pages;
 
 import com.aventstack.extentreports.Status;
+import java.io.IOException;
 import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
+import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions;
 import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
 import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class GovernorOperationPage {
 
+    private static final Logger LOGGER = LoggerFactory.getLogger(GovernorOperationPage.class);
+
     private GovernorOperationPage() {
         super();
     }
 
-    public static void approveSerivce(String serviceName) {
-        SetupCDTest.getExtendTest().log(Status.INFO, "Approving the distrbution of the service " + serviceName);
+    public static void approveService(final String serviceName) {
+        SetupCDTest.getExtendTest()
+            .log(Status.INFO, String.format("Approving the distribution of the service '%s'", serviceName));
         GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.DistributionChangeButtons.APPROVE.getValue()).click();
         GeneralUIUtils.waitForLoader();
         GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.DistributionChangeButtons.APPROVE_MESSAGE.getValue())
                 .sendKeys("service " + serviceName + " tested successfully");
         GeneralPageElements.clickOKButton();
+        final String distributionApprovedMsg = String.format("The distribution of the service '%s' was approved", serviceName);
+        try {
+            ExtentTestActions
+                .addScreenshot(Status.INFO,
+                    String.format("governor-distribution-approved-%s", serviceName),
+                    distributionApprovedMsg
+                );
+        } catch (final IOException e) {
+            LOGGER.error("Could not take screenshot of governor distribution approval", e);
+            SetupCDTest.getExtendTest().log(Status.INFO, distributionApprovedMsg);
+        }
         GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtons.SEARCH_BOX.getValue());
     }
 
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/HomePage.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/HomePage.java
index d6485fd..c5cd347 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/HomePage.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/HomePage.java
@@ -20,7 +20,15 @@
 
 package org.openecomp.sdc.ci.tests.pages;
 
+import static org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest.getExtendTest;
+import static org.openecomp.sdc.ci.tests.pages.HomePage.PageElement.REPOSITORY_ICON;
+
+import com.aventstack.extentreports.Status;
+import java.io.File;
+import java.util.List;
+import java.util.UUID;
 import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
+import org.openecomp.sdc.ci.tests.exception.HomePageRuntimeException;
 import org.openecomp.sdc.ci.tests.utilities.DownloadManager;
 import org.openecomp.sdc.ci.tests.utilities.FileHandling;
 import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
@@ -28,17 +36,18 @@
 import org.openqa.selenium.WebElement;
 import org.openqa.selenium.support.ui.ExpectedConditions;
 import org.openqa.selenium.support.ui.WebDriverWait;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
-import java.io.File;
-import java.util.List;
+public class HomePage {
 
-public class HomePage extends GeneralPageElements {
+    private static final Logger LOGGER = LoggerFactory.getLogger(HomePage.class);
 
     private static final int WAIT_FOR_ELEMENT_TIME_OUT = 30;
     private static final int WAIT_FOR_LOADER_TIME_OUT = 600;
 
-    public HomePage() {
-        super();
+    private HomePage() {
+
     }
 
     public static void showVspRepository() {
@@ -56,9 +65,9 @@
         HomePage.showVspRepository();
         boolean vspFound = HomePage.searchForVSP(vspName);
         if (vspFound) {
-            List<WebElement> elemenetsFromTable = getElemenetsFromTable();
+            List<WebElement> elementsFromTable = GeneralPageElements.getElementsFromTable();
             WebDriverWait wait = new WebDriverWait(GeneralUIUtils.getDriver(), WAIT_FOR_ELEMENT_TIME_OUT);
-            WebElement findElement = wait.until(ExpectedConditions.visibilityOf(elemenetsFromTable.get(1)));
+            WebElement findElement = wait.until(ExpectedConditions.visibilityOf(elementsFromTable.get(1)));
             findElement.click();
             GeneralUIUtils.waitForLoader();
             GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ImportVfRepository.IMPORT_VSP.getValue());
@@ -68,42 +77,138 @@
         }
     }
 
-
     public static boolean navigateToHomePage() {
         try {
-            System.out.println("Searching for reporsitory icon.");
-            WebElement repositoryIcon = GeneralUIUtils.getInputElement("repository-icon");
+            LOGGER.debug("Searching for repository icon");
+            final WebElement repositoryIcon = GeneralUIUtils.getInputElement(REPOSITORY_ICON.getTestId());
             if (repositoryIcon != null) {
                 return true;
-            } else {
-                GeneralUIUtils.ultimateWait();
-                List<WebElement> homeButtons = GeneralUIUtils.getElemenetsFromTable(By.xpath("//a[contains(.,'HOME')]"));
-                if (homeButtons.size() != 0) {
-                    for (WebElement home : homeButtons) {
-                        if (home.isDisplayed()) {
-                            home.click();
-                            System.out.println("Clicked on home button");
-                            break;
-                        }
-                    }
-                    GeneralUIUtils.closeErrorMessage();
-                    WebElement homeButton = GeneralUIUtils.getInputElement(DataTestIdEnum.MainMenuButtons.HOME_BUTTON.getValue());
-                    return homeButton.isDisplayed();
-                }
-
             }
-        } catch (Exception innerException) {
-            System.out.println("Can't click on home button.");
+            GeneralUIUtils.ultimateWait();
+            final List<WebElement> homeButtons = GeneralUIUtils
+                .getElementsByLocator(By.xpath("//a[contains(.,'HOME')]"));
+            if (!homeButtons.isEmpty()) {
+                homeButtons.stream().filter(WebElement::isDisplayed).findFirst().ifPresent(webElement -> {
+                    webElement.click();
+                    LOGGER.debug("Clicked on home button");
+                });
+            }
+
+            GeneralUIUtils.closeErrorMessage();
+            WebElement homeButton = GeneralUIUtils
+                .getInputElement(DataTestIdEnum.MainMenuButtons.HOME_BUTTON.getValue());
+            return homeButton != null && homeButton.isDisplayed();
+
+        } catch (final Exception e) {
+            final String msg = "Could not click on home button";
+            getExtendTest()
+                .log(Status.WARNING, msg);
+            LOGGER.warn(msg, e);
             return false;
         }
-        return false;
     }
 
     public static File downloadVspCsarToDefaultDirectory(String vspName) throws Exception {
         GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
         DownloadManager.downloadCsarByNameFromVSPRepository(vspName, "");
-        File latestFilefromDir = FileHandling.getLastModifiedFileNameFromDir();
-        return latestFilefromDir;
+        return FileHandling.getLastModifiedFileNameFromDir();
+    }
+
+    public static void findComponentAndClick(final String resourceName) {
+        findComponent(resourceName);
+        clickComponent(resourceName);
+    }
+
+    public static void findComponent(final String resourceName) {
+        LOGGER.debug("Searching for component '{}'", resourceName);
+        getExtendTest().log(Status.INFO, "Searching for " + resourceName + " in home tab");
+        clearSearchResults(getSearchInput());
+        searchForComponent(resourceName);
+    }
+
+    private static WebElement getSearchInput() {
+        WebElement searchTextbox;
+        try {
+            searchTextbox = TopSearchComponent.getComponentInput();
+            LOGGER.debug("Search textbox '{}' selected", TopSearchComponent.SEARCH_INPUT_TEST_ID);
+        } catch (final Exception e) {
+            final String errorMsg = "Top Search bar was not visible";
+            getExtendTest().log(Status.ERROR, errorMsg);
+            throw new HomePageRuntimeException(errorMsg, e);
+        }
+        return searchTextbox;
+    }
+
+    private static void clearSearchResults(final WebElement searchTextbox) {
+        try {
+            LOGGER.debug("Clearing search results before searching");
+            TopSearchComponent.replaceSearchValue(searchTextbox, UUID.randomUUID().toString());
+            MainRightContainer.isEmptyResult();
+        } catch (final Exception e) {
+            final String errorMsg = "Could not clean up the search result";
+            getExtendTest().log(Status.ERROR, errorMsg);
+            throw new HomePageRuntimeException(errorMsg, e);
+        }
+    }
+
+    private static void searchForComponent(final String resourceName) {
+        try {
+            LOGGER.debug("Searching for '{}'", resourceName);
+            TopSearchComponent.replaceSearchValue(resourceName);
+            MainRightContainer.isResultVisible(resourceName);
+        } catch (final Exception e) {
+            final String errorMsg = String.format("Could not find the component '%s' after search", resourceName);
+            getExtendTest().log(Status.ERROR, errorMsg);
+            throw new HomePageRuntimeException(errorMsg, e);
+        }
+    }
+
+    public static void clickComponent(final String resourceName) {
+        LOGGER.debug("Clicking on the component " + resourceName);
+        try {
+            getExtendTest()
+                .log(Status.INFO, String.format("Clicking on the '%s' component from home tab", resourceName));
+            GeneralUIUtils.clickOnElementByTestId(resourceName);
+        } catch (final Exception e) {
+            final String errorMsg = String.format("Could not click on home tab component '%s' ", resourceName);
+            getExtendTest().log(Status.ERROR, e.getMessage());
+            throw new HomePageRuntimeException(errorMsg, e);
+        }
+        try {
+            GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.GeneralElementsEnum.LIFECYCLE_STATE.getValue());
+        } catch (final Exception e) {
+            final String errorMsg = String.format("Expecting to be inside component '%s' screen", resourceName);
+            getExtendTest().log(Status.ERROR, e.getMessage());
+            throw new HomePageRuntimeException(errorMsg, e);
+        }
+    }
+
+    public static void waitForElement(PageElement homePageElement) {
+        final String cssClass = homePageElement.getCssClass();
+        LOGGER.debug("Waiting for{} visibility", cssClass);
+        GeneralUIUtils.getWebElementByClassName(cssClass);
+        LOGGER.debug("{} is visible", cssClass);
+    }
+
+    public enum PageElement {
+        COMPONENT_PANEL("w-sdc-main-right-container", null),
+        REPOSITORY_ICON(null, "repository-icon");
+
+        private final String cssClass;
+        private final String testId;
+
+        PageElement(String cssClass, String testId) {
+            this.cssClass = cssClass;
+            this.testId = testId;
+        }
+
+        public String getCssClass() {
+            return cssClass;
+        }
+
+        public String getTestId() {
+            return testId;
+        }
     }
 
 }
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/MainRightContainer.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/MainRightContainer.java
new file mode 100644
index 0000000..1bbda64
--- /dev/null
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/MainRightContainer.java
@@ -0,0 +1,54 @@
+/*
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation
+ *  ================================================================================
+ *  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.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.pages;
+
+import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
+
+/**
+ * Represents the "w-sdc-main-right-container" panel that shows the list of resources/components.
+ */
+public class MainRightContainer {
+
+    public static final String CSS_CLASS = "w-sdc-main-right-container";
+
+    private MainRightContainer() {
+
+    }
+
+    /**
+     * Checks if the resource is visible in the panel/container.
+     *
+     * @param resourceName the resource name to search in the panel/container
+     * @return {@code true} if the resource is visible, {@code false} otherwise.
+     */
+    public static boolean isResultVisible(final String resourceName) {
+        return GeneralUIUtils.isElementVisibleByTestId(resourceName);
+    }
+
+    /**
+     * Checks if the panel/container is showing no resources.
+     *
+     * @return {@code true} if the panel/container is empty, {@code false} otherwise.
+     */
+    public static boolean isEmptyResult() {
+        return GeneralUIUtils.isElementInvisibleByTestId("dashboard-Elements");
+    }
+
+}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/PropertiesAssignmentPage.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/PropertiesAssignmentPage.java
index 72622f4..a90f463 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/PropertiesAssignmentPage.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/PropertiesAssignmentPage.java
@@ -24,131 +24,127 @@
 import com.aventstack.extentreports.Status;
 import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
 import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.PropertiesAssignmentScreen;
+import org.openecomp.sdc.ci.tests.exception.PropertiesAssignmentPageException;
 import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
 import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
 import org.openqa.selenium.Keys;
 import org.openqa.selenium.NoSuchElementException;
 import org.openqa.selenium.WebElement;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class PropertiesAssignmentPage {
 
+    private static final Logger LOGGER = LoggerFactory.getLogger(PropertiesAssignmentPage.class);
+
     private PropertiesAssignmentPage() {
 
     }
 
     public static void clickOnInputTab() {
-        SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on Input Tab"));
+        SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Input Tab");
         GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.INPUTS_TAB.getValue());
-        //GeneralUIUtils.ultimateWait();
     }
 
     public static void clickOnPropertiesTab() {
-        SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on Properties Tab"));
+        SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Properties Tab");
         GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.PROPERTIES_TAB.getValue());
-        //GeneralUIUtils.ultimateWait();
     }
 
     public static void clickOnCompositionRightTab() {
-        SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on Composition Right Tab"));
+        SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Composition Right Tab");
         GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.COMPOSITION_TAB.getValue());
-        //GeneralUIUtils.ultimateWait();
     }
 
     public static void clickOnPropertyStructureRightTab() {
-        SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on Property Structure Right Tab"));
+        SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Property Structure Right Tab");
         GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.PROPERTY_STRUCTURE_TAB.getValue());
-        //GeneralUIUtils.ultimateWait();
     }
 
     public static void clickOnDeclareButton() {
-        SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on Declare Button"));
+        SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Declare Button");
         GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.DECLARE_BUTTON.getValue());
-        //GeneralUIUtils.ultimateWait();
     }
 
     public static void clickOnSaveButton() {
-        SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on Save Button"));
+        SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Save Button");
         GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.SAVE_BUTTON.getValue());
-        //GeneralUIUtils.ultimateWait();
     }
 
     public static void clickOnDiscardButton() {
-        SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on Discard Button"));
+        SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Discard Button");
         GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.DISCARD_BUTTON.getValue());
-        //GeneralUIUtils.ultimateWait();
     }
 
     public static void clickOnDialogSaveButton() {
-        SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on Save Button in Dialog Popup"));
+        SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Save Button in Dialog Popup");
         GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.SAVE_DIALOG_SAVE.getValue());
-        //GeneralUIUtils.ultimateWait();
     }
 
     public static void clickOnDialogDiscardButton() {
-        SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on Discard Button in Dialog Popup"));
+        SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Discard Button in Dialog Popup");
         GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.SAVE_DIALOG_DISCARD.getValue());
-        //GeneralUIUtils.ultimateWait();
     }
 
     public static void clickOnDialogCancelButton() {
-        SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on Cancel Button in Dialog Popup"));
+        SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Cancel Button in Dialog Popup");
         GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.SAVE_DIALOG_CANCEL.getValue());
-//        GeneralUIUtils.ultimateWait();
     }
 
     public static void clickOnEditButton(String propertyName) {
-        SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on Edit button "));
+        SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Edit button ");
         GeneralUIUtils.clickOnElementByTestId(PropertyNameBuilder.buildPopupField(propertyName));
-        //GeneralUIUtils.ultimateWait();
     }
 
     public static void clickOnSetButton() {
-        SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on Set button in a property popup "));
+        SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Set button in a property popup ");
         GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.FILTER_SET_BUTTON.getValue());
-//        GeneralUIUtils.ultimateWait();
     }
 
     public static void clickOnExpandButton(String propertyName, int index) {
-        SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on Expand Complex Property Button"));
+        SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Expand Complex Property Button");
         GeneralUIUtils.clickOnElementByTestId(PropertyNameBuilder.buildIExpandButton(propertyName, index));
-//        GeneralUIUtils.ultimateWait();
     }
 
-    public static void findSearchBoxAndClick(String resourceName) throws Exception {
+    public static void findSearchBoxAndClick(final String resourceName) throws PropertiesAssignmentPageException {
         SetupCDTest.getExtendTest().log(Status.INFO, "Searching for " + resourceName + " in Properties");
-        WebElement searchTextbox = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.PropertiesAssignmentScreen.SEARCH_BOX.getValue());
         try {
+            final WebElement searchTextbox = GeneralUIUtils
+                .getWebElementByTestID(DataTestIdEnum.PropertiesAssignmentScreen.SEARCH_BOX.getValue());
             searchTextbox.clear();
             searchTextbox.sendKeys(resourceName);
             GeneralUIUtils.ultimateWait();
-        } catch (Exception e) {
-            SetupCDTest.getExtendTest().log(Status.INFO, "Can't interact with search bar");
-            e.printStackTrace();
+        } catch (final Exception e) {
+            final String errorMsg = String.format("Could not interact with search bar, test id '%s'",
+                PropertiesAssignmentScreen.SEARCH_BOX.getValue());
+            LOGGER.error(errorMsg, e);
+            SetupCDTest.getExtendTest().log(Status.ERROR, errorMsg);
+            throw new PropertiesAssignmentPageException(errorMsg, e);
         }
 
         try {
             SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on the %s component in Properties", resourceName));
-            GeneralUIUtils.clickOnElementByInputTestIdWithoutWait(resourceName);
+            GeneralUIUtils.clickOnElementChildByTestIdWithoutWait(resourceName);
             GeneralUIUtils.ultimateWait();
             GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.GeneralElementsEnum.LIFECYCLE_STATE.getValue());
-        } catch (Exception e) {
-            SetupCDTest.getExtendTest().log(Status.INFO, "Can't click on component named " + resourceName);
-            e.printStackTrace();
+        } catch (final Exception e) {
+            final String errorMsg = String.format("Could not click on component named '%s'", resourceName);
+            LOGGER.error(errorMsg, e);
+            SetupCDTest.getExtendTest().log(Status.ERROR, errorMsg);
+            throw new PropertiesAssignmentPageException(errorMsg, e);
         }
     }
 
-    public static void clickOnProperty(String propertyName) throws Exception {
-
+    private static void clickOnProperty(String propertyName) {
         SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on the %s component in Properties", propertyName));
         GeneralUIUtils.clickOnElementByTestId(propertyName);
-        //GeneralUIUtils.ultimateWait();
         GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.GeneralElementsEnum.LIFECYCLE_STATE.getValue());
     }
 
     public static void clickOnAddValueToList(String propertyName) throws Exception {
         try {
             SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on the Add To List button of %s component in Properties", propertyName));
-            GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.ADD_TO_LIST_BUTTON.getValue() + propertyName); //GeneralUIUtils.ultimateWait();
+            GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.ADD_TO_LIST_BUTTON.getValue() + propertyName);
             GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.GeneralElementsEnum.LIFECYCLE_STATE.getValue());
         } catch (Exception e) {
             SetupCDTest.getExtendTest().log(Status.INFO, "Can't click on Add To List button of component named " + propertyName);
@@ -159,8 +155,7 @@
     public static void clickODeleteValueFromList(String propertyName, int index) throws Exception {
         try {
             SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on the Delete From List button of %s component in Properties", propertyName));
-            GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.DELETE_FROM_LIST_BUTTON.getValue() + propertyName + "." + String.valueOf(index));
-            //GeneralUIUtils.ultimateWait();
+            GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.DELETE_FROM_LIST_BUTTON.getValue() + propertyName + "." + index);
             GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.GeneralElementsEnum.LIFECYCLE_STATE.getValue());
         } catch (Exception e) {
             SetupCDTest.getExtendTest().log(Status.INFO, "Can't click on Delete From List button of component named " + propertyName);
@@ -169,25 +164,23 @@
     }
 
     public static void clickOnDeleteInputButton() {
-        SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on Delete Input Button"));
+        SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Delete Input Button");
         GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.INPUT_DELETE_BUTTON.getValue());
-        //GeneralUIUtils.ultimateWait();
     }
 
     public static void clickOnDeleteInputDialogConfirmationButton() {
-        SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on Delete Input Dialog Confirmation Button"));
+        SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Delete Input Dialog Confirmation Button");
         GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.INPUT_DELETE_DIALOG_DELETE.getValue());
-        //GeneralUIUtils.ultimateWait();
     }
 
-    public static void clickOnComponentInComposition(String resourceName) throws Exception {
+    public static void clickOnComponentInComposition(final String resourceName) throws Exception {
+        SetupCDTest.getExtendTest()
+            .log(Status.INFO, String.format("Clicking on the %s component on Properties screen", resourceName));
         try {
-            SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on the %s component on Properties screen", resourceName));
-            GeneralUIUtils.clickOnElementByTestId(resourceName); //GeneralUIUtils.ultimateWait();
-            //GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.GeneralElementsEnum.LIFECYCLE_STATE.getValue());
-        } catch (Exception e) {
+            GeneralUIUtils.clickOnElementByTestId(resourceName);
+        } catch (final Exception e) {
             SetupCDTest.getExtendTest().log(Status.INFO, "Can't click on component named " + resourceName);
-            e.printStackTrace();
+            throw e;
         }
     }
 
@@ -267,51 +260,43 @@
 
     //Filter Actions
     public static void clickOnFilterButton() {
-        SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on Filter button "));
+        SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Filter button ");
         GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.FILTER_BUTTON.getValue());
-        //GeneralUIUtils.ultimateWait();
     }
 
     public static void clickOnFilterAllCheckbox() {
-        SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on Filter All Checkbox "));
+        SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Filter All Checkbox ");
         GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.FILTER_CHECKBOX_ALL.getValue());
-        //GeneralUIUtils.ultimateWait();
     }
 
     public static void clickOnFilterCPCheckbox() {
-        SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on Filter CP Checkbox "));
+        SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Filter CP Checkbox ");
         GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.FILTER_CHECKBOX_CP.getValue());
-        //GeneralUIUtils.ultimateWait();
     }
 
     public static void clickOnFilterVfcCheckbox() {
-        SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on Filter VFC Checkbox "));
+        SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Filter VFC Checkbox ");
         GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.FILTER_CHECKBOX_VFC.getValue());
-        //GeneralUIUtils.ultimateWait();
     }
 
     public static void clickOnFilterVlCheckbox() {
-        SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on Filter VL Checkbox "));
+        SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Filter VL Checkbox ");
         GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.FILTER_CHECKBOX_VL.getValue());
-        //GeneralUIUtils.ultimateWait();
     }
 
     public static void clickOnFilterApplyButton() {
-        SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on Filter Apply Button"));
+        SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Filter Apply Button");
         GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.FILTER_APPLY_BUTTON.getValue());
-        //GeneralUIUtils.ultimateWait();
     }
 
     public static void clickOnFilterCloseButton() {
-        SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on Filter Close Button"));
+        SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Filter Close Button");
         GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.FILTER_CLOSE_BUTTON.getValue());
-        //GeneralUIUtils.ultimateWait();
     }
 
     public static void clickOnFilterClearAllButton() {
-        SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on Filter Clear All Button"));
+        SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Filter Clear All Button");
         GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.CLEAR_FILTER_BUTTON.getValue());
-        //GeneralUIUtils.ultimateWait();
     }
 
     public static void findFilterBoxAndClick(String resourceName) throws Exception {
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ResourceLeftMenu.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ResourceLeftMenu.java
index 6d92a03..02c077a 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ResourceLeftMenu.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ResourceLeftMenu.java
@@ -25,11 +25,11 @@
 
 public class ResourceLeftMenu implements ComponentLeftMenu {
 
-    public void moveToGeneralScreen() throws Exception {
+    public void moveToGeneralScreen() {
         GeneralUIUtils.moveToStep(StepsEnum.GENERAL);
     }
 
-    public void moveToIconScreen() throws Exception {
+    public void moveToIconScreen() {
         GeneralUIUtils.moveToStep(StepsEnum.ICON);
     }
 
@@ -41,19 +41,19 @@
         GeneralUIUtils.moveToStep(StepsEnum.INFORMATION_ARTIFACT);
     }
 
-    public void moveToPropertiesScreen() throws Exception {
+    public void moveToPropertiesScreen() {
         GeneralUIUtils.moveToStep(StepsEnum.PROPERTIES);
     }
 
-    public void moveToCompositionScreen() throws Exception {
+    public void moveToCompositionScreen() {
         GeneralUIUtils.moveToStep(StepsEnum.COMPOSITION);
     }
 
-    public void moveToActivityLogScreen() throws Exception {
+    public void moveToActivityLogScreen() {
         GeneralUIUtils.moveToStep(StepsEnum.ACTIVITY_LOG);
     }
 
-    public void moveToDeploymentViewScreen() throws Exception {
+    public void moveToDeploymentViewScreen() {
         GeneralUIUtils.moveToStep(StepsEnum.DEPLOYMENT_VIEW);
     }
 
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/TesterOperationPage.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/TesterOperationPage.java
index 3252681..08a797e 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/TesterOperationPage.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/TesterOperationPage.java
@@ -28,7 +28,7 @@
 public class TesterOperationPage {
 
     private TesterOperationPage() {
-        super();
+
     }
 
     public static void certifyComponent(String componentName) throws Exception {
@@ -37,7 +37,7 @@
     }
 
     public static void clickAcceptCertificationButton(String componentName) throws Exception {
-        ExtentTestActions.log(Status.INFO, "Accepting certifiction of " + componentName);
+        ExtentTestActions.log(Status.INFO, "Accepting certification of " + componentName);
         String actionDuration = GeneralUIUtils.getActionDuration(() ->
         {
             try {
@@ -46,7 +46,7 @@
                 e.printStackTrace();
             }
         });
-        ExtentTestActions.log(Status.INFO, componentName + " is certifed", actionDuration);
+        ExtentTestActions.log(Status.INFO, componentName + " is certified", actionDuration);
 
     }
 
@@ -66,10 +66,8 @@
     private static void clickAcceptCertificationButtonWithoutDuration(String componentName) throws Exception {
         try {
             GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.LifeCyleChangeButtons.ACCEPT.getValue());
-            //GeneralUIUtils.ultimateWait();
             GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ModalItems.ACCEPT_TESTING_MESSAGE.getValue()).sendKeys(componentName + " tested successfuly");
             GeneralPageElements.clickOKButton();
-            //GeneralUIUtils.sleep(2000);
             GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtons.SEARCH_BOX.getValue());
         } catch (Exception e) {
             throw new Exception("Accepting certification of " + componentName + " failed");
@@ -79,10 +77,7 @@
     private static void clickStartTestingButtonWithoutDuration() throws Exception {
         try {
             GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.LifeCyleChangeButtons.START_TESTING.getValue());
-            //GeneralUIUtils.ultimateWait();
             GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.LifeCyleChangeButtons.ACCEPT.getValue());
-            //GeneralUIUtils.ultimateWait();
-            //GeneralUIUtils.sleep(1000);
         } catch (Exception e) {
             throw new Exception("Start testing failed");
         }
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/TopSearchComponent.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/TopSearchComponent.java
new file mode 100644
index 0000000..a919bb0
--- /dev/null
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/TopSearchComponent.java
@@ -0,0 +1,69 @@
+/*
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation
+ *  ================================================================================
+ *  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.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.pages;
+
+import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
+import org.openqa.selenium.Keys;
+import org.openqa.selenium.WebElement;
+
+/**
+ * Represents the "top-search" search component in the main upper toolbar.
+ */
+public class TopSearchComponent {
+
+    public static final String CSS_CLASS = "top-search";
+    public static final String SEARCH_INPUT_TEST_ID = "main-menu-input-search";
+
+    private TopSearchComponent() {
+
+    }
+
+    /**
+     * Gets the search component input, waiting for it's visibility.
+     *
+     * @return search component input with test id {@link #SEARCH_INPUT_TEST_ID}
+     */
+    public static WebElement getComponentInput() {
+        return GeneralUIUtils.getWebElementByTestID(SEARCH_INPUT_TEST_ID);
+    }
+
+    /**
+     * Replaces the current search input value by the given value. This prevents to trigger the search twice by cleaning
+     * the input (triggers the search) and then pasting the value (triggers the search again).
+     *
+     * @param value the value to search
+     */
+    public static void replaceSearchValue(final String value) {
+        replaceSearchValue(getComponentInput(), value);
+    }
+
+    /**
+     * Replaces the current search input value by selecting it with Ctrl+A shortcut and pasting the given value. This
+     * prevents to trigger the search twice by cleaning the input (triggers the search) and then pasting the value
+     * (triggers the search again).
+     *
+     * @param searchTextInput input web element
+     * @param value the value to search
+     */
+    public static void replaceSearchValue(final WebElement searchTextInput, final String value) {
+        searchTextInput.sendKeys(Keys.chord(Keys.CONTROL, "a"), value);
+    }
+
+}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/DownloadManager.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/DownloadManager.java
index 1d8d514..a88f726 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/DownloadManager.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/DownloadManager.java
@@ -24,6 +24,7 @@
 import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
 import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions;
 import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
+import org.openecomp.sdc.ci.tests.pages.GeneralPageElements;
 import org.openecomp.sdc.ci.tests.pages.HomePage;
 import org.openqa.selenium.WebElement;
 
@@ -50,8 +51,8 @@
         boolean vspFound = HomePage.searchForVSP(vspName);
         if (vspFound) {
             ExtentTestActions.log(Status.INFO, String.format("Going to downloading VSP %s", vspName));
-            List<WebElement> elemenetsFromTable = HomePage.getElemenetsFromTable();
-            elemenetsFromTable.get(1).click();
+            final List<WebElement> elementsFromTable = GeneralPageElements.getElementsFromTable();
+            elementsFromTable.get(1).click();
             GeneralUIUtils.waitForLoader();
             GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ImportVfRepository.DOWNLOAD_CSAR.getValue());
             ExtentTestActions.log(Status.INFO, "Succeeded to downloaded CSAR file named " + vspName + " into folder " + SetupCDTest.getWindowTest().getDownloadDirectory());
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 153b14e..a416324 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
@@ -23,8 +23,9 @@
 import com.aventstack.extentreports.Status;
 import org.apache.commons.io.FileUtils;
 import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
+import org.openecomp.sdc.ci.tests.exception.GeneralUiRuntimeException;
 import org.openecomp.sdc.ci.tests.execute.setup.DriverFactory;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
+import org.openecomp.sdc.ci.tests.pages.HomePage;
 import org.openecomp.sdc.ci.tests.utils.Utils;
 import org.openqa.selenium.By;
 import org.openqa.selenium.JavascriptExecutor;
@@ -50,12 +51,17 @@
 import java.util.UUID;
 import java.util.concurrent.TimeUnit;
 import java.util.function.Supplier;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
+import static org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest.getExtendTest;
 import static org.testng.AssertJUnit.assertTrue;
 
 
 public final class GeneralUIUtils {
 
+    private static final Logger LOGGER = LoggerFactory.getLogger(GeneralUIUtils.class);
+
     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;";
 
@@ -66,24 +72,19 @@
     private static final int NAP_PERIOD = 100;
     private static final int DURATION_FORMATIN = 60;
 
+    private GeneralUIUtils () {
+
+    }
+
     public static int getTimeOut() {
         return TIME_OUT;
     }
 
-    /**************** DRIVER ****************/
-
     public static WebDriver getDriver() {
-        try {
-            return DriverFactory.getDriver();
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        return null;
+        return DriverFactory.getDriver();
     }
 
-    /****************************************/
-
-    public static List<WebElement> getElemenetsFromTable(By by) {
+    public static List<WebElement> getElementsByLocator(By by) {
         return getDriver().findElements(by);
     }
 
@@ -115,9 +116,10 @@
         return getWebElementByTestID(dataTestId, TIME_OUT);
     }
 
-    public static WebElement getWebElementByTestID(String dataTestId, int timeout) {
-        WebDriverWait wait = new WebDriverWait(getDriver(), timeout);
-        return wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(String.format(DATA_TESTS_ID, dataTestId))));
+    public static WebElement getWebElementByTestID(final String dataTestId, final int timeout) {
+        final WebDriverWait wait = new WebDriverWait(getDriver(), timeout);
+        return wait
+            .until(ExpectedConditions.visibilityOfElementLocated(By.xpath(String.format(DATA_TESTS_ID, dataTestId))));
     }
 
     public static boolean isWebElementExistByTestId(String dataTestId) {
@@ -224,16 +226,25 @@
     }
 
     public static void clickOnElementByTestId(String dataTestId) {
+        LOGGER.debug("Clicking on the element by test id " + dataTestId);
         clickOnElementByTestIdWithoutWait(dataTestId);
+        LOGGER.debug("Waiting after clicking element by test id " + dataTestId);
+        ultimateWait();
+        LOGGER.debug(String.format("Waiting after clicking element by test id '%s' finished", dataTestId));
+    }
+
+    public static void clickOnElementChildByTestId(String dataTestId) {
+        clickOnElementChildByTestIdWithoutWait(dataTestId);
         ultimateWait();
     }
 
-    public static void clickOnElementByTestIdWithoutWait(String dataTestId) {
-        WebDriverWait wait = new WebDriverWait(getDriver(), TIME_OUT);
-        wait.until(ExpectedConditions.elementToBeClickable(By.xpath(String.format(DATA_TESTS_ID, dataTestId)))).click();
+    public static void clickOnElementByTestIdWithoutWait(final String dataTestId) {
+        final WebDriverWait wait = new WebDriverWait(getDriver(), TIME_OUT);
+        wait
+            .until(ExpectedConditions.elementToBeClickable(By.xpath(String.format(DATA_TESTS_ID, dataTestId)))).click();
     }
 
-    public static void clickOnElementByInputTestIdWithoutWait(String dataTestId) {
+    public static void clickOnElementChildByTestIdWithoutWait(String dataTestId) {
         WebDriverWait wait = new WebDriverWait(getDriver(), TIME_OUT);
         wait.until(ExpectedConditions.elementToBeClickable(By.xpath(String.format(DATA_TESTS_ID, dataTestId) + "//*"))).click();
     }
@@ -308,31 +319,15 @@
     }
 
     public static void waitForLoader(int timeOut) {
+        final String loaderClass = "tlv-loader";
         final int sleepDuration = 500;
         sleep(sleepDuration);
-        waitForElementInVisibilityBy(By.className("tlv-loader"), timeOut);
+        LOGGER.debug("Waiting {}s for '.{}'", timeOut, loaderClass);
+        waitForElementInVisibilityBy(By.className(loaderClass), timeOut);
     }
 
-    public static void findComponentAndClick(String resourceName) throws Exception {
-        SetupCDTest.getExtendTest().log(Status.INFO, "Searching for " + resourceName + " in homepage");
-        WebElement searchTextbox = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtons.SEARCH_BOX.getValue());
-        try {
-            searchTextbox.clear();
-            searchTextbox.sendKeys(resourceName);
-            ultimateWait();
-        } catch (Exception e) {
-            SetupCDTest.getExtendTest().log(Status.INFO, "Can't interact with search bar");
-            e.printStackTrace();
-        }
-
-        try {
-            SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on the %s component from home screen", resourceName));
-            clickOnElementByTestId(resourceName);
-            getWebElementByTestID(DataTestIdEnum.GeneralElementsEnum.LIFECYCLE_STATE.getValue());
-        } catch (Exception e) {
-            SetupCDTest.getExtendTest().log(Status.INFO, "Can't click on component named " + resourceName);
-            e.printStackTrace();
-        }
+    public static void findComponentAndClick(final String resourceName) {
+        HomePage.findComponentAndClick(resourceName);
     }
 
     public static void windowZoomOut() {
@@ -356,18 +351,19 @@
     public static void sleep(int duration) {
         try {
             Thread.sleep(duration);
-        } catch (InterruptedException e) {
-            throw new RuntimeException(e);
+        } catch (final InterruptedException e) {
+            Thread.currentThread().interrupt();
+            throw new GeneralUiRuntimeException("The thread was interrupted during a sleep", e);
         }
     }
 
-    public static void moveToStep(DataTestIdEnum.StepsEnum stepName) {
-        SetupCDTest.getExtendTest().log(Status.INFO, String.format("Going to %s page ", stepName.toString()));
+    public static void moveToStep(final DataTestIdEnum.StepsEnum stepName) {
+        getExtendTest().log(Status.INFO, String.format("Going to %s page ", stepName.toString()));
         moveToStep(stepName.getValue());
     }
 
-    public static void moveToStep(String dataTestId) {
-        clickOnElementByTestId(dataTestId);
+    public static void moveToStep(final String dataTestId) {
+        clickOnElementChildByTestId(dataTestId);
     }
 
 
@@ -436,7 +432,6 @@
             ultimateWait();
             WebElement area = getWebElementByTestID(areaId);
             JavascriptExecutor javascript = (JavascriptExecutor) getDriver();
-            //highlightMyElement(area);
             Object executeScript = javascript.executeScript("arguments[0].click();", area, COLOR_YELLOW_BORDER_4PX_SOLID_YELLOW);
             waitForLoader(timeout);
             ultimateWait();
@@ -450,7 +445,6 @@
 
     public static WebElement clickOnAreaJS(WebElement areaId) throws InterruptedException {
         JavascriptExecutor javascript = (JavascriptExecutor) getDriver();
-        //highlightMyElement(area);
         javascript.executeScript("arguments[0].click();", areaId, COLOR_YELLOW_BORDER_4PX_SOLID_YELLOW);
         return areaId;
     }
@@ -479,10 +473,12 @@
     }
 
     public static void waitForAngular() {
+        LOGGER.debug("Waiting for angular");
         final int webDriverWaitingTime = 90;
         WebDriverWait wait = new WebDriverWait(getDriver(), webDriverWaitingTime, NAP_PERIOD);
         wait.until(AdditionalConditions.pageLoadWait());
         wait.until(AdditionalConditions.angularHasFinishedProcessing());
+        LOGGER.debug("Waiting for angular finished");
     }
 
     public static Object getAllElementAttributes(WebElement element) {
@@ -523,7 +519,7 @@
         long estimateTime = System.nanoTime();
         long duration = TimeUnit.NANOSECONDS.toSeconds(estimateTime - startTime);
         if (duration > TIME_OUT) {
-            SetupCDTest.getExtendTest().log(Status.WARNING, String.format("Delays on page, %d seconds", duration));
+            getExtendTest().log(Status.WARNING, String.format("Delays on page, %d seconds", duration));
         }
     }
 
@@ -604,7 +600,9 @@
 
     public static void waitForBackLoader(int timeOut) {
         sleep(NAP_PERIOD);
-        waitForElementInVisibilityBy(By.className("tlv-loader-back"), timeOut);
+        final String backLoaderClass = "tlv-loader-back";
+        LOGGER.debug("Waiting {}s for '.{}'", timeOut, backLoaderClass);
+        waitForElementInVisibilityBy(By.className(backLoaderClass), timeOut);
     }
 
     public static void addStringtoClipboard(String text) {
@@ -669,23 +667,23 @@
     }
 
     public static void clickOnBrowserBackButton() throws Exception {
-        SetupCDTest.getExtendTest().log(Status.INFO, "Going to press on back browser button.");
+        getExtendTest().log(Status.INFO, "Going to press on back browser button.");
         getDriver().navigate().back();
         ultimateWait();
     }
 
     public static String copyCurrentURL() throws Exception {
-        SetupCDTest.getExtendTest().log(Status.INFO, "Copying current URL");
+        getExtendTest().log(Status.INFO, "Copying current URL");
         return getDriver().getCurrentUrl();
     }
 
     public static void navigateToURL(String url) throws Exception {
-        SetupCDTest.getExtendTest().log(Status.INFO, "Navigating to URL " + url);
+        getExtendTest().log(Status.INFO, "Navigating to URL " + url);
         getDriver().navigate().to(url);
     }
 
     public static void refreshWebpage() throws Exception {
-        SetupCDTest.getExtendTest().log(Status.INFO, "Refreshing Webpage");
+        getExtendTest().log(Status.INFO, "Refreshing Webpage");
         getDriver().navigate().refresh();
         ultimateWait();
     }
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 bbcfffd..d4d2731 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
@@ -22,7 +22,7 @@
 
 import com.aventstack.extentreports.Status;
 import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.datatypes.AmdocsLicenseMembers;
+import org.openecomp.sdc.ci.tests.datatypes.VendorLicenseModel;
 import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
 import org.openecomp.sdc.ci.tests.datatypes.HeatMetaFirstLevelDefinition;
 import org.openecomp.sdc.ci.tests.datatypes.LifeCycleStateEnum;
@@ -58,7 +58,7 @@
         boolean vspFound = HomePage.searchForVSP(vspName);
 
         if (vspFound) {
-            List<WebElement> elementsFromTable = HomePage.getElemenetsFromTable();
+            List<WebElement> elementsFromTable = GeneralPageElements.getElementsFromTable();
             elementsFromTable.get(1).click();
             GeneralUIUtils.waitForLoader();
 
@@ -135,7 +135,7 @@
         importUpdateVSP(vsp, false, false);
     }
 
-    public static void updateVnfAndValidate(String filePath, VendorSoftwareProductObject vsp, String updatedVnfFile, User user) throws Throwable {
+    public static void updateVnfAndValidate(String filePath, VendorSoftwareProductObject vsp, String updatedVnfFile, User user) throws Exception {
         ExtentTestActions.log(Status.INFO, String.format("Going to update the VNF with %s......", updatedVnfFile));
         System.out.println(String.format("Going to update the VNF with %s......", updatedVnfFile));
 
@@ -147,11 +147,9 @@
     }
 
     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);
+        ExtentTestActions.log(Status.INFO, String.format("Creating VSP from package '%s'", vnfFile));
+        final VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(user);
+        return VendorSoftwareProductRestUtils.createVSP(resourceReqDetails, vnfFile, filepath, user, vendorLicenseModel);
     }
 
 
@@ -159,8 +157,9 @@
         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);
-        VendorSoftwareProductObject createVendorSoftwareProduct = VendorSoftwareProductRestUtils.createVendorSoftwareProduct(resourceReqDetails, vnfFile, filepath, user, amdocsLicenseMembers);
+        VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(user);
+        VendorSoftwareProductObject createVendorSoftwareProduct = VendorSoftwareProductRestUtils.createVendorSoftwareProduct(resourceReqDetails, vnfFile, filepath, user,
+            vendorLicenseModel);
         String vspName = createVendorSoftwareProduct.getName();
 
         DownloadManager.downloadCsarByNameFromVSPRepository(vspName, createVendorSoftwareProduct.getVspId());
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/PortMirroringUtils.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/PortMirroringUtils.java
index a3f8a5c..e26e5f3 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/PortMirroringUtils.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/PortMirroringUtils.java
@@ -29,7 +29,7 @@
 import org.openecomp.sdc.be.model.Resource;
 import org.openecomp.sdc.be.model.Service;
 import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.datatypes.AmdocsLicenseMembers;
+import org.openecomp.sdc.ci.tests.datatypes.VendorLicenseModel;
 import org.openecomp.sdc.ci.tests.datatypes.CanvasElement;
 import org.openecomp.sdc.ci.tests.datatypes.CanvasManager;
 import org.openecomp.sdc.ci.tests.datatypes.ConnectionWizardPopUpObject;
@@ -71,11 +71,13 @@
     public static ServiceContainer createServiceFromHeatFile(String filePath, String vnfFile) throws Throwable {
 //1. Import VSP v1.0
         User sdncDesignerDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
-        AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(sdncDesignerDetails1);
-        SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating Vendor Software License (VLM): %s v1.0", amdocsLicenseMembers.getVendorLicenseName()));
+        VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(sdncDesignerDetails1);
+        SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating Vendor Software License (VLM): %s v1.0", vendorLicenseModel
+            .getVendorLicenseName()));
         ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
         SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating Vendor Software Product (VSP): %s v1.0 from heat file: %s ", resourceReqDetails.getName(), vnfFile));
-        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails1, amdocsLicenseMembers);
+        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails1,
+            vendorLicenseModel);
 //        VendorSoftwareProductObject vendorSoftwareProductObject = OnboardViaApis.fillVendorSoftwareProductObjectWithMetaData(vnfFile, createVendorSoftwareProduct);
 //2. Create VF, certify - v1.0 is created
         resourceReqDetails = org.openecomp.sdc.ci.tests.utils.general.OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
@@ -93,7 +95,7 @@
         service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
         SetupCDTest.getExtendTest().log(Status.INFO, String.format("Certify the Service"));
 
-        return new ServiceContainer(service, resource, vendorSoftwareProductObject, amdocsLicenseMembers);
+        return new ServiceContainer(service, resource, vendorSoftwareProductObject, vendorLicenseModel);
     }
 
     public static Resource generatePNFAndUpdateInput(String resourceName, String vendorModelNumber, User user) throws Exception {
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/ServiceUIUtils.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/ServiceUIUtils.java
index 367dd3b..2e5ba74 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/ServiceUIUtils.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/ServiceUIUtils.java
@@ -21,7 +21,8 @@
 package org.openecomp.sdc.ci.tests.utilities;
 
 import com.aventstack.extentreports.Status;
-import org.junit.rules.TestName;
+import java.util.ArrayList;
+import java.util.List;
 import org.openecomp.sdc.be.model.User;
 import org.openecomp.sdc.be.model.category.CategoryDefinition;
 import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
@@ -29,20 +30,15 @@
 import org.openecomp.sdc.ci.tests.datatypes.enums.ServiceCategoriesEnum;
 import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
 import org.openecomp.sdc.ci.tests.pages.GeneralPageElements;
+import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
 import org.openecomp.sdc.ci.tests.pages.ServiceGeneralPage;
 import org.openqa.selenium.Keys;
-import org.openqa.selenium.WebDriver;
 import org.openqa.selenium.WebElement;
 
-import java.util.ArrayList;
-import java.util.List;
-
 public class ServiceUIUtils {
 
-    protected static WebDriver driver;
+    private ServiceUIUtils() {
 
-    public ServiceUIUtils(TestName name, String className) {
-        super();
     }
 
     private static void defineTagsList2(List<String> serviceTags) {
@@ -55,20 +51,20 @@
         }
     }
 
-    public static void fillServiceGeneralPage(ServiceReqDetails service, User user) throws Exception {
-        SetupCDTest.getExtendTest().log(Status.INFO, String.format("Fill in metadata values in general page"));
+    public static void fillServiceGeneralPage(final ServiceReqDetails service) {
+        SetupCDTest.getExtendTest().log(Status.INFO, "Fill in metadata values in general page");
         ServiceGeneralPage.defineName(service.getName());
-        ServiceGeneralPage.defineDescription(service.getDescription());
-        ServiceGeneralPage.defineCategory(service.getCategories().get(0).getName());
+        ResourceGeneralPage.defineDescription(service.getDescription());
+        ResourceGeneralPage.defineCategory(service.getCategories().get(0).getName());
         ServiceGeneralPage.defineProjectCode(service.getProjectCode());
         defineTagsList2(service.getTags());
-        ServiceGeneralPage.defineContactId(service.getContactId());
+        ResourceGeneralPage.defineContactId(service.getContactId());
         GeneralUIUtils.clickSomewhereOnPage();
     }
 
-    public static void createService(ServiceReqDetails service, User user) throws Exception {
+    public static void createService(ServiceReqDetails service) {
         clickAddService();
-        fillServiceGeneralPage(service, user);
+        fillServiceGeneralPage(service);
         GeneralPageElements.clickCreateButton();
         SetupCDTest.getExtendTest().log(Status.INFO, String.format("The service %s was created", service.getName()));
     }
diff --git a/ui-ci/src/main/resources/ci/testSuites/devOnboardE2EOneFileSanity.xml b/ui-ci/src/main/resources/ci/testSuites/devOnboardE2EOneFileSanity.xml
index 8802e9f..acf4be4 100644
--- a/ui-ci/src/main/resources/ci/testSuites/devOnboardE2EOneFileSanity.xml
+++ b/ui-ci/src/main/resources/ci/testSuites/devOnboardE2EOneFileSanity.xml
@@ -4,7 +4,7 @@
   <test name="uitests">
     <classes>
     	<!--onboard-->
-   		<class name="org.openecomp.sdc.ci.tests.execute.sanity.OnboardingFlowsUI">
+   		<class name="org.openecomp.sdc.ci.tests.execute.sanity.OnboardingFlowsUi">
    			  <methods>
 				<include name="onboardVNFTestSanityOneFile"/>
 			  </methods>
diff --git a/ui-ci/src/main/resources/ci/testSuites/extendedSanity.xml b/ui-ci/src/main/resources/ci/testSuites/extendedSanity.xml
index 1e295a2..00b98c9 100644
--- a/ui-ci/src/main/resources/ci/testSuites/extendedSanity.xml
+++ b/ui-ci/src/main/resources/ci/testSuites/extendedSanity.xml
@@ -7,7 +7,7 @@
     <classes>
     	
     	<class name="org.openecomp.sdc.ci.tests.execute.sanity.ToscaValidationTest"/>
-   		<class name="org.openecomp.sdc.ci.tests.execute.sanity.OnboardingFlowsUI">
+   		<class name="org.openecomp.sdc.ci.tests.execute.sanity.OnboardingFlowsUi">
    			  <methods>
 				<exclude name="onboardVNFTestSanity"/>
 				<exclude name="onboardVNFShotFlow"/>
diff --git a/ui-ci/src/main/resources/ci/testSuites/onapUiSanity.xml b/ui-ci/src/main/resources/ci/testSuites/onapUiSanity.xml
index 3945088..245524d 100644
--- a/ui-ci/src/main/resources/ci/testSuites/onapUiSanity.xml
+++ b/ui-ci/src/main/resources/ci/testSuites/onapUiSanity.xml
@@ -1,34 +1,33 @@
 <?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">
+<suite name="uitests" configfailurepolicy="continue" parallel="methods" thread-count="1"
+  data-provider-thread-count="1">
 
-    <parameter name="makeDistribution"  value="false"/>
+  <parameter name="makeDistribution" value="false"/>
 
   <test name="uiSanity">
     <classes>
 
-        <class name="org.openecomp.sdc.ci.tests.execute.sanity.Vf">
-            <methods>
-                <include name="changeInstanceNameInVfTest"/>
-            </methods>
-        </class>
+      <class name="org.openecomp.sdc.ci.tests.execute.sanity.Vf">
+        <methods>
+          <include name="changeInstanceNameInVfTest"/>
+        </methods>
+      </class>
 
-        <class name="org.openecomp.sdc.ci.tests.execute.sanity.Service">
-            <methods>
-                <include name="updateService"/>
-            </methods>
-        </class>
+      <class name="org.openecomp.sdc.ci.tests.execute.sanity.Service">
+        <methods>
+          <include name="updateService"/>
+        </methods>
+      </class>
 
 
-        <class name="org.openecomp.sdc.ci.tests.execute.sanity.OnboardingFlowsUI">
-            <methods>
-                <include name="onapOnboardVNFflow"/>
-                <include name="onapOnboardVSPValidationsSanityFlow"/>
-            </methods>
-        </class>
+      <class name="org.openecomp.sdc.ci.tests.execute.sanity.OnboardingFlowsUi">
+        <methods>
+          <include name="onapOnboardVNFflow"/>
+          <include name="onapOnboardVSPValidationsSanityFlow"/>
+        </methods>
+      </class>
 
-
-						
     </classes>
-  </test> <!-- uitests -->
-</suite> <!-- uisuite -->
\ No newline at end of file
+  </test>
+</suite>
diff --git a/ui-ci/src/main/resources/ci/testSuites/vspValidationAllFlows.xml b/ui-ci/src/main/resources/ci/testSuites/vspValidationAllFlows.xml
index f159548..71677a9 100644
--- a/ui-ci/src/main/resources/ci/testSuites/vspValidationAllFlows.xml
+++ b/ui-ci/src/main/resources/ci/testSuites/vspValidationAllFlows.xml
@@ -1,23 +1,23 @@
-<?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"/>
-                <include name="onapOnboardVSPComplianceCheckOperations"/>
-                <include name="onapOnboardVSPCertificationQueryOperations"/>
-            </methods>
-        </class>
-
-    </classes>
-  </test> <!-- uitests -->
+<?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"/>
+                <include name="onapOnboardVSPComplianceCheckOperations"/>
+                <include name="onapOnboardVSPCertificationQueryOperations"/>
+            </methods>
+        </class>
+
+    </classes>
+  </test> <!-- uitests -->
 </suite> <!-- uisuite -->
\ No newline at end of file
