How to use property_getRawFromJson method of org.cerberus.engine.gwt.impl.PropertyService class

Best Cerberus-source code snippet using org.cerberus.engine.gwt.impl.PropertyService.property_getRawFromJson

Source:PropertyService.java Github

copy

Full Screen

...655 case TestCaseCountryProperties.TYPE_GETFROMJSON:656 testCaseExecutionData = this.property_getFromJson(testCaseExecutionData, execution, forceRecalculation);657 break;658 case TestCaseCountryProperties.TYPE_GETRAWFROMJSON:659 testCaseExecutionData = this.property_getRawFromJson(testCaseExecutionData, execution);660 break;661 case TestCaseCountryProperties.TYPE_GETFROMGROOVY:662 testCaseExecutionData = this.property_getFromGroovy(testCaseExecutionData, execution, testCaseCountryProperty, forceRecalculation);663 break;664 case TestCaseCountryProperties.TYPE_GETFROMCOMMAND:665 testCaseExecutionData = this.property_getFromCommand(testCaseExecutionData, execution, testCaseCountryProperty, forceRecalculation);666 break;667 case TestCaseCountryProperties.TYPE_GETELEMENTPOSITION:668 testCaseExecutionData = this.property_getElementPosition(testCaseExecutionData, execution, testCaseCountryProperty, forceRecalculation);669 break;670 case TestCaseCountryProperties.TYPE_GETFROMNETWORKTRAFFIC:671 testCaseExecutionData = this.property_getFromNetworkTraffic(testCaseExecutionData, testCaseCountryProperty, execution, forceRecalculation);672 break;673 case TestCaseCountryProperties.TYPE_GETOTP:674 testCaseExecutionData = this.property_getOTP(testCaseExecutionData, testCaseCountryProperty, execution, forceRecalculation);675 break;676 // DEPRECATED Property types.677 case TestCaseCountryProperties.TYPE_EXECUTESOAPFROMLIB: // DEPRECATED678 testCaseExecutionData = this.property_executeSoapFromLib(testCaseExecutionData, execution, testCaseStepActionExecution, testCaseCountryProperty, forceRecalculation);679 res = testCaseExecutionData.getPropertyResultMessage();680 res.setDescription(MESSAGE_DEPRECATED + " " + res.getDescription());681 testCaseExecutionData.setPropertyResultMessage(res);682 logEventService.createForPrivateCalls("ENGINE", TestCaseCountryProperties.TYPE_EXECUTESOAPFROMLIB, MESSAGE_DEPRECATED + " Deprecated Property triggered by TestCase : ['" + test + "|" + testCase + "']");683 LOG.warn(MESSAGE_DEPRECATED + " Deprecated Property " + TestCaseCountryProperties.TYPE_EXECUTESOAPFROMLIB + " triggered by TestCase : ['" + test + "'|'" + testCase + "']");684 break;685 case TestCaseCountryProperties.TYPE_EXECUTESQLFROMLIB: // DEPRECATED686 testCaseExecutionData = this.property_executeSqlFromLib(testCaseExecutionData, testCaseCountryProperty, execution, forceRecalculation);687 res = testCaseExecutionData.getPropertyResultMessage();688 res.setDescription(MESSAGE_DEPRECATED + " " + res.getDescription());689 testCaseExecutionData.setPropertyResultMessage(res);690 logEventService.createForPrivateCalls("ENGINE", TestCaseCountryProperties.TYPE_EXECUTESQLFROMLIB, MESSAGE_DEPRECATED + " Deprecated Property triggered by TestCase : ['" + test + "|" + testCase + "']");691 LOG.warn(MESSAGE_DEPRECATED + " Deprecated Property " + TestCaseCountryProperties.TYPE_EXECUTESQLFROMLIB + " triggered by TestCase : ['" + test + "'|'" + testCase + "']");692 break;693 default:694 res = new MessageEvent(MessageEventEnum.PROPERTY_FAILED_UNKNOWNPROPERTY);695 res.setDescription(res.getDescription().replace("%PROPERTY%", testCaseCountryProperty.getType()));696 testCaseExecutionData.setPropertyResultMessage(res);697 }698 execution_count++;699 // Adding secrets if property looks like a password700 addPropertyASecret(testCaseExecutionData, execution);701 }702 if (execution_count >= 2) { // If there were at least 1 retry, we notify it in the result message.703 res = testCaseExecutionData.getPropertyResultMessage();704 res.setDescription("Retried " + (execution_count - 1) + " time(s) with " + periodms + "ms period - " + res.getDescription());705 testCaseExecutionData.setPropertyResultMessage(res);706 }707 if (forced_retry) { // If the retry and period parameter was changed, we notify it in the result message.708 res = testCaseExecutionData.getPropertyResultMessage();709 res.setDescription(forced_retry_message + " - " + res.getDescription());710 testCaseExecutionData.setPropertyResultMessage(res);711 }712 } else {713 // cache activated and entry exist. We set the current value with cache entry data and notify the result from the messsage.714 TestCaseExecutionData testCaseExecutionDataFromCache = data;715 testCaseExecutionData.setFromCache("Y");716 testCaseExecutionData.setDataLib(testCaseExecutionDataFromCache.getDataLib());717 testCaseExecutionData.setValue(testCaseExecutionDataFromCache.getValue());718 testCaseExecutionData.setJsonResult(testCaseExecutionDataFromCache.getJsonResult());719 DateFormat df = new SimpleDateFormat(DateUtil.DATE_FORMAT_DISPLAY);720 res = new MessageEvent(MessageEventEnum.PROPERTY_SUCCESS_FROMCACHE).resolveDescription("ID", String.valueOf(testCaseExecutionDataFromCache.getId())).resolveDescription("DATE", df.format(testCaseExecutionDataFromCache.getStart()));721 testCaseExecutionData.setPropertyResultMessage(res);722 if (!StringUtil.isNullOrEmpty(testCaseExecutionDataFromCache.getJsonResult())) {723 // Convert json to HashMap.724 List<HashMap<String, String>> result = null;725 result = new ArrayList<>();726 try {727 LOG.debug("Converting Json : " + testCaseExecutionDataFromCache.getJsonResult());728 JSONArray json = new JSONArray(testCaseExecutionDataFromCache.getJsonResult());729 for (int i = 0; i < json.length(); i++) {730 JSONObject explrObject = json.getJSONObject(i);731 LOG.debug(explrObject.toString());732 HashMap<String, String> resultHash = new HashMap<>();733 Iterator<?> nameItr = explrObject.keys();734 while (nameItr.hasNext()) {735 String name = (String) nameItr.next();736 if (name.equals("KEY")) {737 resultHash.put("", explrObject.getString(name));738 } else {739 resultHash.put(name, explrObject.getString(name));740 }741 }742 result.add(resultHash);743 }744 } catch (JSONException ex) {745 java.util.logging.Logger.getLogger(PropertyService.class.getName()).log(Level.SEVERE, null, ex);746 LOG.error(ex, ex);747 }748 testCaseExecutionData.setDataLibRawData(result);749 // Adding secrets if property looks like a password750 addPropertyASecret(testCaseExecutionData, execution);751 //Record result in filessytem.752 recorderService.recordTestDataLibProperty(execution.getId(), testCaseCountryProperty.getProperty(), 1, result, execution.getSecrets());753 }754 }755 } catch (CerberusEventException ex) {756 LOG.error(ex.toString(), ex);757 testCaseExecutionData.setEnd(new Date().getTime());758 testCaseExecutionData.setPropertyResultMessage(ex.getMessageError());759 }760 testCaseExecutionData.setEnd(new Date().getTime());761 if (LOG.isDebugEnabled()) {762 LOG.debug("Finished to calculate Property : '" + testCaseCountryProperty.getProperty() + "'");763 }764 }765 private void addPropertyASecret(TestCaseExecutionData executionData, TestCaseExecution execution) {766 if (executionData.getProperty().contains("PASSW")) {767 execution.appendSecret(executionData.getValue());768 }769 }770 private TestCaseExecutionData property_getFromCommand(TestCaseExecutionData testCaseExecutionData, TestCaseExecution tCExecution, TestCaseCountryProperties testCaseCountryProperty, boolean forceRecalculation) {771 // Check if script has been correctly defined772 String script = testCaseExecutionData.getValue1();773 if (script == null || script.isEmpty()) {774 testCaseExecutionData.setPropertyResultMessage(new MessageEvent(MessageEventEnum.PROPERTY_FAILED_GETFROMCOMMAND_NULL));775 return testCaseExecutionData;776 }777 // Try to evaluate Command script778 try {779 if (tCExecution.getAppTypeEngine().equals(Application.TYPE_APK)) {780 String message = androidAppiumService.executeCommandString(tCExecution.getSession(), script, testCaseExecutionData.getValue2());781 String value = "";782 if (!StringUtil.isNullOrEmpty(message)) {783 value = message;784 }785 testCaseExecutionData.setValue(value);786 testCaseExecutionData.setPropertyResultMessage(new MessageEvent(MessageEventEnum.PROPERTY_SUCCESS_GETFROMCOMMAND).resolveDescription("VALUE", value));787 } else if (tCExecution.getAppTypeEngine().equals(Application.TYPE_IPA)) {788 String message = iosAppiumService.executeCommandString(tCExecution.getSession(), script, testCaseExecutionData.getValue2());789 String value = "";790 if (!StringUtil.isNullOrEmpty(message)) {791 value = message;792 }793 testCaseExecutionData.setValue(value);794 testCaseExecutionData.setPropertyResultMessage(new MessageEvent(MessageEventEnum.PROPERTY_SUCCESS_GETFROMCOMMAND).resolveDescription("VALUE", value));795 } else {796 MessageEvent res = new MessageEvent(MessageEventEnum.PROPERTY_FAILED_FEATURENOTSUPPORTED);797 res.setDescription(res.getDescription().replace("%APPTYPE%", tCExecution.getAppTypeEngine()));798 res.setDescription(res.getDescription().replace("%PROPTYPE%", testCaseExecutionData.getType()));799 testCaseExecutionData.setPropertyResultMessage(res);800 }801 } catch (Exception e) {802 LOG.debug("Exception Running Command Script :" + e.getMessage());803 testCaseExecutionData.setPropertyResultMessage(new MessageEvent(MessageEventEnum.PROPERTY_FAILED_GETFROMCOMMAND_EXCEPTION).resolveDescription("REASON", e.getMessage()));804 }805 return testCaseExecutionData;806 }807 private TestCaseExecutionData property_getElementPosition(TestCaseExecutionData testCaseExecutionData, TestCaseExecution tCExecution, TestCaseCountryProperties testCaseCountryProperty, boolean forceRecalculation) {808 // Check if script has been correctly defined809 String script = testCaseExecutionData.getValue1();810 if (script == null || script.isEmpty()) {811 testCaseExecutionData.setPropertyResultMessage(new MessageEvent(MessageEventEnum.PROPERTY_FAILED_GETELEMENTPOSITION_NULL));812 return testCaseExecutionData;813 }814 try {815 Identifier identifier = new Identifier();816 if (script != null) {817 identifier = identifierService.convertStringToIdentifier(script);818 }819 if (tCExecution.getAppTypeEngine().equals(Application.TYPE_APK)) {820 String message = androidAppiumService.getElementPosition(tCExecution.getSession(), identifier);821 String value = "";822 if (!StringUtil.isNullOrEmpty(message)) {823 value = message;824 }825 testCaseExecutionData.setValue(value);826 testCaseExecutionData.setPropertyResultMessage(new MessageEvent(MessageEventEnum.PROPERTY_SUCCESS_GETELEMENTPOSITION).resolveDescription("VALUE", value));827 } else if (tCExecution.getAppTypeEngine().equals(Application.TYPE_IPA)) {828 String message = iosAppiumService.getElementPosition(tCExecution.getSession(), identifier);829 String value = "";830 if (!StringUtil.isNullOrEmpty(message)) {831 value = message;832 }833 testCaseExecutionData.setValue(value);834 testCaseExecutionData.setPropertyResultMessage(new MessageEvent(MessageEventEnum.PROPERTY_SUCCESS_GETELEMENTPOSITION).resolveDescription("VALUE", value));835 } else {836 MessageEvent res = new MessageEvent(MessageEventEnum.PROPERTY_FAILED_FEATURENOTSUPPORTED);837 res.setDescription(res.getDescription().replace("%APPTYPE%", tCExecution.getAppTypeEngine()));838 res.setDescription(res.getDescription().replace("%PROPTYPE%", testCaseExecutionData.getType()));839 testCaseExecutionData.setPropertyResultMessage(res);840 }841 } catch (Exception e) {842 LOG.debug("Exception Running Command Script :" + e.getMessage());843 testCaseExecutionData.setPropertyResultMessage(new MessageEvent(MessageEventEnum.PROPERTY_FAILED_GETELEMENTPOSITION_EXCEPTION).resolveDescription("REASON", e.getMessage()));844 }845 return testCaseExecutionData;846 }847 private TestCaseExecutionData property_executeSqlFromLib(TestCaseExecutionData testCaseExecutionData, TestCaseCountryProperties testCaseCountryProperty, TestCaseExecution tCExecution, boolean forceCalculation) {848 try {849 String script = this.sqlLibraryService.findSqlLibraryByKey(testCaseExecutionData.getValue1()).getScript();850 testCaseExecutionData.setValue1(script); //TODO use the new library851 } catch (CerberusException ex) {852 LOG.warn(ex);853 MessageEvent res = new MessageEvent(MessageEventEnum.PROPERTY_FAILED_SQL_SQLLIB_NOTEXIT);854 res.setDescription(res.getDescription().replace("%SQLLIB%", testCaseExecutionData.getValue1()));855 testCaseExecutionData.setPropertyResultMessage(res);856 testCaseExecutionData.setEnd(new Date().getTime());857 return testCaseExecutionData;858 }859 testCaseExecutionData = this.property_getFromSql(testCaseExecutionData, tCExecution, testCaseCountryProperty, forceCalculation);860 return testCaseExecutionData;861 }862 private TestCaseExecutionData property_getFromNetworkTraffic(TestCaseExecutionData testCaseExecutionData, TestCaseCountryProperties testCaseCountryProperty, TestCaseExecution execution, boolean forceCalculation) {863 if ("Y".equalsIgnoreCase(execution.getRobotExecutorObj().getExecutorProxyActive())) {864 String jsonPath = testCaseExecutionData.getValue2();865 if (StringUtil.isNullOrEmpty(jsonPath)) {866 MessageEvent res = new MessageEvent(MessageEventEnum.PROPERTY_FAILED_GETFROMNETWORKTRAFFIC_MISSINGJSONPATH);867 testCaseExecutionData.setPropertyResultMessage(res);868 return testCaseExecutionData;869 }870 try {871 //TODO : check if HAR is the same than the last one to avoid to download same har file several times872 // String remoteHarMD5 = "http://" + tCExecution.getRobotExecutorObj().getHost() + ":" + tCExecution.getRobotExecutorObj().getExecutorExtensionPort() + "/getHarMD5?uuid="+tCExecution.getRemoteProxyUUID();873 Integer indexFrom = 0;874 if (!execution.getNetworkTrafficIndexList().isEmpty()) {875 // Take the value from the last entry.876 indexFrom = execution.getNetworkTrafficIndexList().get(execution.getNetworkTrafficIndexList().size() - 1).getIndexRequestNb();877 }878 JSONObject harRes = executorService.getHar(testCaseExecutionData.getValue1(), false, execution.getRobotExecutorObj().getExecutorExtensionHost(), execution.getRobotExecutorObj().getExecutorExtensionPort(),879 execution.getRemoteProxyUUID(), execution.getSystem(), indexFrom);880 harRes = harService.enrichWithStats(harRes, execution.getCountryEnvironmentParameters().getDomain(), execution.getSystem(), execution.getNetworkTrafficIndexList());881 //Record result in filessytem.882 testCaseExecutionData.addFileList(recorderService.recordProperty(execution.getId(), testCaseExecutionData.getProperty(), 1, harRes.toString(1), execution.getSecrets()));883 String valueFromJson = this.jsonService.getFromJson(harRes.toString(), null, jsonPath);884 if (valueFromJson != null) {885 testCaseExecutionData.setValue(valueFromJson);886 MessageEvent res = new MessageEvent(MessageEventEnum.PROPERTY_SUCCESS_GETFROMNETWORKTRAFFIC)887 .resolveDescription("PARAM", jsonPath)888 .resolveDescription("VALUE", valueFromJson)889 .resolveDescription("INDEX", String.valueOf(execution.getNetworkTrafficIndexList().size()))890 .resolveDescription("NBHITS", String.valueOf(indexFrom));891 testCaseExecutionData.setPropertyResultMessage(res);892 } else {893 MessageEvent res = new MessageEvent(MessageEventEnum.PROPERTY_FAILED_GETFROMNETWORKTRAFFIC_PATHNOTFOUND);894 res.setDescription(res.getDescription().replace("%PARAM%", jsonPath));895 testCaseExecutionData.setPropertyResultMessage(res);896 }897 } catch (Exception ex) {898 LOG.warn("Exception when getting property from Network Traffic.", ex);899 MessageEvent res = new MessageEvent(MessageEventEnum.PROPERTY_FAILED_GETFROMNETWORKTRAFFIC_PROXYNOTACTIVE);900 res.setDescription(res.getDescription().replace("%DETAIL%", ex.toString()));901 testCaseExecutionData.setPropertyResultMessage(res);902 testCaseExecutionData.setEnd(new Date().getTime());903 return testCaseExecutionData;904 }905 } else {906 MessageEvent res = new MessageEvent(MessageEventEnum.PROPERTY_FAILED_GETFROMNETWORKTRAFFIC_PROXYNOTACTIVE);907 res.setDescription(res.getDescription().replace("%ROBOT%", execution.getRobot()));908 res.setDescription(res.getDescription().replace("%EXECUTOR%", execution.getRobotExecutor()));909 testCaseExecutionData.setPropertyResultMessage(res);910 }911 return testCaseExecutionData;912 }913 private TestCaseExecutionData property_getOTP(TestCaseExecutionData testCaseExecutionData, TestCaseCountryProperties testCaseCountryProperty, TestCaseExecution tCExecution, boolean forceCalculation) {914 if (StringUtil.isNullOrEmpty(testCaseExecutionData.getValue1())) {915 MessageEvent res = new MessageEvent(MessageEventEnum.PROPERTY_FAILED_GETOTP_MISSINGPARAMETER);916 testCaseExecutionData.setPropertyResultMessage(res);917 testCaseExecutionData.setEnd(new Date().getTime());918 return testCaseExecutionData;919 }920 try {921 String secretKey = testCaseExecutionData.getValue1();922 Totp totp = new Totp(secretKey);923 String val = totp.now();924 testCaseExecutionData.setValue(val);925 testCaseExecutionData.setPropertyResultMessage(new MessageEvent(MessageEventEnum.PROPERTY_SUCCESS_GETOTP).resolveDescription("VALUE", val));926 } catch (Exception ex) {927 LOG.warn("Exception when getting property from OTP secret.", ex);928 MessageEvent res = new MessageEvent(MessageEventEnum.PROPERTY_FAILED_GETOTP);929 res.setDescription(res.getDescription().replace("%DETAIL%", ex.toString()));930 testCaseExecutionData.setPropertyResultMessage(res);931 testCaseExecutionData.setEnd(new Date().getTime());932 return testCaseExecutionData;933 }934 return testCaseExecutionData;935 }936 private TestCaseExecutionData property_getFromSql(TestCaseExecutionData testCaseExecutionData, TestCaseExecution tCExecution, TestCaseCountryProperties testCaseCountryProperty, boolean forceCalculation) {937 return sQLService.calculateOnDatabase(testCaseExecutionData, testCaseCountryProperty, tCExecution);938 }939 private TestCaseExecutionData property_calculateText(TestCaseExecutionData testCaseExecutionData, TestCaseCountryProperties testCaseCountryProperty, boolean forceRecalculation) {940 if (TestCaseCountryProperties.NATURE_RANDOM.equals(testCaseCountryProperty.getNature())941 //TODO CTE Voir avec B. Civel "RANDOM_NEW"942 || (testCaseCountryProperty.getNature().equals(TestCaseCountryProperties.NATURE_RANDOMNEW))) {943 if (testCaseCountryProperty.getLength().equals("0")) {944 MessageEvent res = new MessageEvent(MessageEventEnum.PROPERTY_FAILED_TEXTRANDOMLENGHT0);945 testCaseExecutionData.setPropertyResultMessage(res);946 } else {947 String charset;948 if (testCaseExecutionData.getValue1() != null && !"".equals(testCaseExecutionData.getValue1().trim())) {949 charset = testCaseExecutionData.getValue1();950 } else {951 charset = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";952 }953 String value = StringUtil.getRandomString(ParameterParserUtil.parseIntegerParam(testCaseCountryProperty.getLength(), 0), charset);954 testCaseExecutionData.setValue(value);955 MessageEvent res = new MessageEvent(MessageEventEnum.PROPERTY_SUCCESS_RANDOM);956 res.setDescription(res.getDescription().replace("%FORCED%", forceRecalculation == true ? "Re-" : ""));957 res.setDescription(res.getDescription().replace("%VALUE%", ParameterParserUtil.securePassword(value, testCaseCountryProperty.getProperty())));958 testCaseExecutionData.setPropertyResultMessage(res);959// if (testCaseCountryProperty.getNature().equals("RANDOM_NEW")) {960// //TODO check if value exist on DB ( used in another test case of the revision )961// }962 }963 } else {964 LOG.debug("Setting value : " + testCaseExecutionData.getValue1());965 String value = testCaseExecutionData.getValue1();966 testCaseExecutionData.setValue(value);967 MessageEvent res = new MessageEvent(MessageEventEnum.PROPERTY_SUCCESS_TEXT);968 res.setDescription(res.getDescription().replace("%VALUE%", ParameterParserUtil.securePassword(value, testCaseCountryProperty.getProperty())));969 testCaseExecutionData.setPropertyResultMessage(res);970 }971 return testCaseExecutionData;972 }973 private TestCaseExecutionData property_getFromHtmlVisible(TestCaseExecutionData testCaseExecutionData, TestCaseExecution tCExecution, TestCaseCountryProperties testCaseCountryProperty, boolean forceCalculation) {974 try {975 Identifier identifier = identifierService.convertStringToIdentifier(testCaseExecutionData.getValue1());976 String valueFromHTML = this.webdriverService.getValueFromHTMLVisible(tCExecution.getSession(), identifier);977 if (valueFromHTML != null) {978 testCaseExecutionData.setValue(valueFromHTML);979 MessageEvent res = new MessageEvent(MessageEventEnum.PROPERTY_SUCCESS_HTMLVISIBLE);980 res.setDescription(res.getDescription().replace("%ELEMENT%", testCaseExecutionData.getValue1()));981 res.setDescription(res.getDescription().replace("%VALUE%", valueFromHTML));982 testCaseExecutionData.setPropertyResultMessage(res);983 } else {984 MessageEvent res = new MessageEvent(MessageEventEnum.PROPERTY_FAILED_HTMLVISIBLE_ELEMENTDONOTEXIST);985 res.setDescription(res.getDescription().replace("%ELEMENT%", testCaseExecutionData.getValue1()));986 testCaseExecutionData.setPropertyResultMessage(res);987 }988 } catch (NoSuchElementException exception) {989 LOG.debug(exception.toString());990 MessageEvent res = new MessageEvent(MessageEventEnum.PROPERTY_FAILED_HTMLVISIBLE_ELEMENTDONOTEXIST);991 res.setDescription(res.getDescription().replace("%ELEMENT%", testCaseExecutionData.getValue1()));992 testCaseExecutionData.setPropertyResultMessage(res);993 }994 return testCaseExecutionData;995 }996 private TestCaseExecutionData property_getFromHtml(TestCaseExecutionData testCaseExecutionData, TestCaseExecution tCExecution, TestCaseCountryProperties testCaseCountryProperty, boolean forceCalculation) {997 if (tCExecution.getAppTypeEngine().equals(Application.TYPE_APK)998 || tCExecution.getAppTypeEngine().equals(Application.TYPE_IPA)999 || tCExecution.getAppTypeEngine().equals(Application.TYPE_GUI)) {1000 try {1001 Identifier identifier = identifierService.convertStringToIdentifier(testCaseExecutionData.getValue1());1002 String valueFromHTML = this.webdriverService.getValueFromHTML(tCExecution.getSession(), identifier);1003 if (valueFromHTML != null) {1004 testCaseExecutionData.setValue(valueFromHTML);1005 MessageEvent res = new MessageEvent(MessageEventEnum.PROPERTY_SUCCESS_HTML);1006 res.setDescription(res.getDescription().replace("%ELEMENT%", testCaseExecutionData.getValue1()));1007 res.setDescription(res.getDescription().replace("%VALUE%", valueFromHTML));1008 testCaseExecutionData.setPropertyResultMessage(res);1009 }1010 } catch (NoSuchElementException exception) {1011 LOG.debug(exception.toString());1012 MessageEvent res = new MessageEvent(MessageEventEnum.PROPERTY_FAILED_HTML_ELEMENTDONOTEXIST);1013 res.setDescription(res.getDescription().replace("%ELEMENT%", testCaseExecutionData.getValue1()));1014 testCaseExecutionData.setPropertyResultMessage(res);1015 }1016 } else {1017 MessageEvent res = new MessageEvent(MessageEventEnum.PROPERTY_FAILED_FEATURENOTSUPPORTED);1018 res.setDescription(res.getDescription().replace("%APPTYPE%", tCExecution.getAppTypeEngine()));1019 res.setDescription(res.getDescription().replace("%PROPTYPE%", testCaseExecutionData.getType()));1020 }1021 return testCaseExecutionData;1022 }1023 private TestCaseExecutionData property_getFromJS(TestCaseExecutionData testCaseExecutionData, TestCaseExecution tCExecution, TestCaseCountryProperties testCaseCountryProperty, boolean forceCalculation) {1024 String script = testCaseExecutionData.getValue1();1025 String valueFromJS;1026 String message = "";1027 if (tCExecution.getManualExecution().equals("Y")) {1028 MessageEvent mes = new MessageEvent(MessageEventEnum.PROPERTY_NOTPOSSIBLE);1029 testCaseExecutionData.setPropertyResultMessage(mes);1030 } else {1031 try {1032 valueFromJS = this.webdriverService.getValueFromJS(tCExecution.getSession(), script);1033 } catch (Exception e) {1034 message = e.getMessage().split("\n")[0];1035 LOG.debug("Exception Running JS Script :" + message);1036 valueFromJS = null;1037 }1038 if (valueFromJS != null) {1039 testCaseExecutionData.setValue(valueFromJS);1040 MessageEvent res = new MessageEvent(MessageEventEnum.PROPERTY_SUCCESS_JS);1041 res.setDescription(res.getDescription().replace("%SCRIPT%", script));1042 res.resolveDescription("VALUE", valueFromJS);1043 testCaseExecutionData.setPropertyResultMessage(res);1044 } else {1045 MessageEvent res = new MessageEvent(MessageEventEnum.PROPERTY_FAILED_JS_EXCEPTION);1046 res.setDescription(res.getDescription().replace("%EXCEPTION%", message));1047 testCaseExecutionData.setPropertyResultMessage(res);1048 }1049 }1050 return testCaseExecutionData;1051 }1052 private TestCaseExecutionData property_getFromGroovy(TestCaseExecutionData testCaseExecutionData, TestCaseExecution tCExecution, TestCaseCountryProperties testCaseCountryProperty, boolean forceCalculation) {1053 // Check if script has been correctly defined1054 String script = testCaseExecutionData.getValue1();1055 if (script == null || script.isEmpty()) {1056 testCaseExecutionData.setPropertyResultMessage(new MessageEvent(MessageEventEnum.PROPERTY_FAILED_GETFROMGROOVY_NULL));1057 return testCaseExecutionData;1058 }1059 // Try to evaluate Groovy script1060 try {1061 String valueFromGroovy = groovyService.eval(script);1062 testCaseExecutionData.setValue(valueFromGroovy);1063 testCaseExecutionData.setPropertyResultMessage(new MessageEvent(MessageEventEnum.PROPERTY_SUCCESS_GETFROMGROOVY)1064 .resolveDescription("VALUE", valueFromGroovy));1065 } catch (IGroovyService.IGroovyServiceException e) {1066 LOG.debug("Exception Running Grrovy Script :" + e.getMessage());1067 testCaseExecutionData.setPropertyResultMessage(new MessageEvent(MessageEventEnum.PROPERTY_FAILED_GETFROMGROOVY_EXCEPTION).resolveDescription("REASON", e.getMessage()));1068 }1069 return testCaseExecutionData;1070 }1071 private TestCaseExecutionData property_getAttributeFromHtml(TestCaseExecutionData testCaseExecutionData, TestCaseExecution tCExecution, TestCaseCountryProperties testCaseCountryProperty, boolean forceCalculation) {1072 MessageEvent res;1073 try {1074 Identifier identifier = identifierService.convertStringToIdentifier(testCaseExecutionData.getValue1());1075 String valueFromHTML = this.webdriverService.getAttributeFromHtml(tCExecution.getSession(), identifier, testCaseExecutionData.getValue2());1076 if (valueFromHTML != null) {1077 testCaseExecutionData.setValue(valueFromHTML);1078 res = new MessageEvent(MessageEventEnum.PROPERTY_SUCCESS_GETATTRIBUTEFROMHTML);1079 res.setDescription(res.getDescription().replace("%VALUE%", valueFromHTML));1080 } else {1081 res = new MessageEvent(MessageEventEnum.PROPERTY_FAILED_HTML_ATTRIBUTEDONOTEXIST);1082 }1083 res.setDescription(res.getDescription().replace("%ELEMENT%", testCaseExecutionData.getValue1()));1084 res.setDescription(res.getDescription().replace("%ATTRIBUTE%", testCaseExecutionData.getValue2()));1085 } catch (NoSuchElementException exception) {1086 LOG.debug(exception.toString());1087 res = new MessageEvent(MessageEventEnum.PROPERTY_FAILED_HTMLVISIBLE_ELEMENTDONOTEXIST);1088 res.setDescription(res.getDescription().replace("%ELEMENT%", testCaseExecutionData.getValue1()));1089 }1090 testCaseExecutionData.setPropertyResultMessage(res);1091 return testCaseExecutionData;1092 }1093 private TestCaseExecutionData property_executeSoapFromLib(TestCaseExecutionData testCaseExecutionData, TestCaseExecution tCExecution, TestCaseStepActionExecution testCaseStepActionExecution, TestCaseCountryProperties testCaseCountryProperty, boolean forceCalculation) {1094 String result = null;1095 AnswerItem<String> answerDecode = new AnswerItem<>();1096 try {1097 AppService appService = this.appServiceService.findAppServiceByKey(testCaseExecutionData.getValue1());1098 if (appService != null) {1099 String decodedEnveloppe = appService.getServiceRequest();1100 String decodedServicePath = appService.getServicePath();1101 String decodedMethod = appService.getOperation();1102 String decodedAttachement = appService.getAttachementURL();1103 if (appService.getServiceRequest().contains("%")) {1104 answerDecode = variableService.decodeStringCompletly(appService.getServiceRequest(), tCExecution, testCaseStepActionExecution, false);1105 decodedEnveloppe = answerDecode.getItem();1106 if (!(answerDecode.isCodeStringEquals("OK"))) {1107 // If anything wrong with the decode --> we stop here with decode message in the action result.1108 testCaseExecutionData.setPropertyResultMessage(answerDecode.getResultMessage().resolveDescription("FIELD", "SOAP Service Request"));1109 testCaseExecutionData.setStopExecution(answerDecode.getResultMessage().isStopTest());1110 LOG.debug("Property interupted due to decode 'SOAP Service Request' Error.");1111 return testCaseExecutionData;1112 }1113 }1114 if (appService.getServicePath().contains("%")) {1115 answerDecode = variableService.decodeStringCompletly(appService.getServicePath(), tCExecution, testCaseStepActionExecution, false);1116 decodedServicePath = answerDecode.getItem();1117 if (!(answerDecode.isCodeStringEquals("OK"))) {1118 // If anything wrong with the decode --> we stop here with decode message in the action result.1119 testCaseExecutionData.setPropertyResultMessage(answerDecode.getResultMessage().resolveDescription("FIELD", "SOAP Service Path"));1120 testCaseExecutionData.setStopExecution(answerDecode.getResultMessage().isStopTest());1121 LOG.debug("Property interupted due to decode 'SOAP Service Path.");1122 return testCaseExecutionData;1123 }1124 }1125 if (appService.getOperation().contains("%")) {1126 answerDecode = variableService.decodeStringCompletly(appService.getOperation(), tCExecution, testCaseStepActionExecution, false);1127 decodedMethod = answerDecode.getItem();1128 if (!(answerDecode.isCodeStringEquals("OK"))) {1129 // If anything wrong with the decode --> we stop here with decode message in the action result.1130 testCaseExecutionData.setPropertyResultMessage(answerDecode.getResultMessage().resolveDescription("FIELD", "SOAP Operation"));1131 testCaseExecutionData.setStopExecution(answerDecode.getResultMessage().isStopTest());1132 LOG.debug("Property interupted due to decode 'SOAP Operation.");1133 return testCaseExecutionData;1134 }1135 }1136 if (appService.getAttachementURL().contains("%")) {1137 answerDecode = variableService.decodeStringCompletly(appService.getAttachementURL(), tCExecution, testCaseStepActionExecution, false);1138 decodedAttachement = answerDecode.getItem();1139 if (!(answerDecode.isCodeStringEquals("OK"))) {1140 // If anything wrong with the decode --> we stop here with decode message in the action r1141 // If anything wrong with the decode --> we stop here with decode message in the acesult.1142 testCaseExecutionData.setPropertyResultMessage(answerDecode.getResultMessage().resolveDescription("FIELD", "SOAP Attachement URL"));1143 testCaseExecutionData.setStopExecution(answerDecode.getResultMessage().isStopTest());1144 LOG.debug("Property interupted due to decode 'SOAP Attachement URL.");1145 return testCaseExecutionData;1146 }1147 }1148 //Call Soap and set LastSoapCall of the testCaseExecution.1149 AnswerItem soapCall = soapService.callSOAP(decodedEnveloppe, decodedServicePath, decodedMethod, decodedAttachement, null, null, 60000, tCExecution.getApplicationObj().getSystem());1150 AppService se1 = (AppService) soapCall.getItem();1151// tCExecution.setLastSOAPCalled(soapCall);1152 if (soapCall.isCodeEquals(200)) {1153// SOAPExecution lastSoapCalled = (SOAPExecution) tCExecution.getLastSOAPCalled().getItem();1154 String xmlResponse = se1.getResponseHTTPBody();1155 result = xmlUnitService.getFromXml(xmlResponse, appService.getAttachementURL());1156 }1157 if (result != null) {1158 testCaseExecutionData.setValue(result);1159 MessageEvent res = new MessageEvent(MessageEventEnum.PROPERTY_SUCCESS_SOAP);1160 testCaseExecutionData.setPropertyResultMessage(res);1161 } else {1162 MessageEvent res = new MessageEvent(MessageEventEnum.PROPERTY_FAILED_SOAPFROMLIB_NODATA);1163 testCaseExecutionData.setPropertyResultMessage(res);1164 }1165 }1166 } catch (CerberusException exception) {1167 LOG.error(exception.toString(), exception);1168 MessageEvent res = new MessageEvent(MessageEventEnum.PROPERTY_FAILED_TESTDATA_PROPERTYDONOTEXIST);1169 res.setDescription(res.getDescription().replace("%PROPERTY%", testCaseExecutionData.getValue1()));1170 testCaseExecutionData.setPropertyResultMessage(res);1171 } catch (CerberusEventException ex) {1172 LOG.error(ex.toString(), ex);1173 MessageEvent message = new MessageEvent(MessageEventEnum.ACTION_FAILED_CALLSOAP);1174 message.setDescription(message.getDescription().replace("%SOAPNAME%", testCaseExecutionData.getValue1()));1175 message.setDescription(message.getDescription().replace("%DESCRIPTION%", ex.getMessageError().getDescription()));1176 testCaseExecutionData.setPropertyResultMessage(message);1177 }1178 return testCaseExecutionData;1179 }1180 private TestCaseExecutionData property_getFromXml(TestCaseExecutionData testCaseExecutionData, TestCaseExecution tCExecution, TestCaseCountryProperties testCaseCountryProperty, boolean forceCalculation) {1181 // 1. Get XML value to parse1182 String xmlToParse = null;1183 // If value2 is defined, then take it as XML value to parse1184 if (!(StringUtil.isNullOrEmpty(testCaseExecutionData.getValue2()))) {1185 xmlToParse = testCaseExecutionData.getValue2();1186 } // Else try to get the last known response from service call1187 else if (tCExecution.getLastServiceCalled() != null) {1188 xmlToParse = tCExecution.getLastServiceCalled().getResponseHTTPBody();1189 } // If XML to parse is still null, then there is an error in XML value definition1190 else if (xmlToParse == null) {1191 testCaseExecutionData.setPropertyResultMessage(1192 new MessageEvent(MessageEventEnum.PROPERTY_FAILED_GETFROMXML)1193 .resolveDescription("VALUE1", testCaseExecutionData.getValue1())1194 .resolveDescription("VALUE2", testCaseExecutionData.getValue2()));1195 return testCaseExecutionData;1196 }1197 // Else we can try to parse it thanks to the dedicated service1198 try {1199 String valueFromXml = xmlUnitService.getFromXml(xmlToParse, testCaseExecutionData.getValue1());1200 if (valueFromXml != null) {1201 testCaseExecutionData.setValue(valueFromXml);1202 MessageEvent res = new MessageEvent(MessageEventEnum.PROPERTY_SUCCESS_GETFROMXML);1203 res.setDescription(res.getDescription().replace("%VALUE%", valueFromXml));1204 res.setDescription(res.getDescription().replace("%VALUE1%", testCaseExecutionData.getValue1()));1205 testCaseExecutionData.setPropertyResultMessage(res);1206 } else {1207 MessageEvent res = new MessageEvent(MessageEventEnum.PROPERTY_FAILED_GETFROMXML);1208 res.setDescription(res.getDescription().replace("%VALUE1%", testCaseExecutionData.getValue1()));1209 res.setDescription(res.getDescription().replace("%VALUE2%", testCaseExecutionData.getValue2()));1210 testCaseExecutionData.setPropertyResultMessage(res);1211 }1212 } catch (Exception ex) {1213 LOG.debug(ex.toString());1214 MessageEvent res = new MessageEvent(MessageEventEnum.PROPERTY_FAILED_GETFROMXML);1215 res.setDescription(res.getDescription().replace("%VALUE1%", testCaseExecutionData.getValue1()));1216 res.setDescription(res.getDescription().replace("%VALUE2%", testCaseExecutionData.getValue2()));1217 testCaseExecutionData.setPropertyResultMessage(res);1218 }1219 return testCaseExecutionData;1220 }1221 private TestCaseExecutionData property_getRawFromXml(TestCaseExecutionData testCaseExecutionData, TestCaseExecution tCExecution, TestCaseCountryProperties testCaseCountryProperty, boolean forceCalculation) {1222 // 1. Get XML value to parse1223 String xmlToParse = null;1224 // If value2 is defined, then take it as XML value to parse1225 if (!(StringUtil.isNullOrEmpty(testCaseExecutionData.getValue2()))) {1226 xmlToParse = testCaseExecutionData.getValue2();1227 } // Else try to get the last known response from service call1228 else if (tCExecution.getLastServiceCalled() != null) {1229 xmlToParse = tCExecution.getLastServiceCalled().getResponseHTTPBody();1230 } // If XML to parse is still null, then there is an error in XML value definition1231 else if (xmlToParse == null) {1232 testCaseExecutionData.setPropertyResultMessage(1233 new MessageEvent(MessageEventEnum.PROPERTY_FAILED_GETFROMXML)1234 .resolveDescription("VALUE1", testCaseExecutionData.getValue1())1235 .resolveDescription("VALUE2", testCaseExecutionData.getValue2()));1236 return testCaseExecutionData;1237 }1238 // Else we can try to parse it thanks to the dedicated service1239 try {1240 String valueFromXml = xmlUnitService.getRawFromXml(xmlToParse, testCaseExecutionData.getValue1());1241 if (valueFromXml != null) {1242 testCaseExecutionData.setValue(valueFromXml);1243 MessageEvent res = new MessageEvent(MessageEventEnum.PROPERTY_SUCCESS_GETFROMXML);1244 res.setDescription(res.getDescription().replace("%VALUE%", valueFromXml));1245 res.setDescription(res.getDescription().replace("%VALUE1%", testCaseExecutionData.getValue1()));1246 testCaseExecutionData.setPropertyResultMessage(res);1247 } else {1248 MessageEvent res = new MessageEvent(MessageEventEnum.PROPERTY_FAILED_GETFROMXML);1249 res.setDescription(res.getDescription().replace("%VALUE1%", testCaseExecutionData.getValue1()));1250 res.setDescription(res.getDescription().replace("%VALUE2%", testCaseExecutionData.getValue2()));1251 testCaseExecutionData.setPropertyResultMessage(res);1252 }1253 } catch (Exception ex) {1254 LOG.debug(ex.toString());1255 MessageEvent res = new MessageEvent(MessageEventEnum.PROPERTY_FAILED_GETFROMXML);1256 res.setDescription(res.getDescription().replace("%VALUE1%", testCaseExecutionData.getValue1()));1257 res.setDescription(res.getDescription().replace("%VALUE2%", testCaseExecutionData.getValue2()));1258 testCaseExecutionData.setPropertyResultMessage(res);1259 }1260 return testCaseExecutionData;1261 }1262 private TestCaseExecutionData property_getFromCookie(TestCaseExecutionData testCaseExecutionData, TestCaseExecution tCExecution, TestCaseCountryProperties testCaseCountryProperty, boolean forceCalculation) {1263 try {1264 String valueFromCookie = this.webdriverService.getFromCookie(tCExecution.getSession(), testCaseExecutionData.getValue1(), testCaseExecutionData.getValue2());1265 if (valueFromCookie != null) {1266 if (!valueFromCookie.equals("cookieNotFound")) {1267 testCaseExecutionData.setValue(valueFromCookie);1268 MessageEvent res = new MessageEvent(MessageEventEnum.PROPERTY_SUCCESS_GETFROMCOOKIE);1269 res.setDescription(res.getDescription().replace("%COOKIE%", testCaseExecutionData.getValue1()));1270 res.setDescription(res.getDescription().replace("%PARAM%", testCaseExecutionData.getValue2()));1271 res.setDescription(res.getDescription().replace("%VALUE%", valueFromCookie));1272 testCaseExecutionData.setPropertyResultMessage(res);1273 } else {1274 MessageEvent res = new MessageEvent(MessageEventEnum.PROPERTY_FAILED_GETFROMCOOKIE_COOKIENOTFOUND);1275 res.setDescription(res.getDescription().replace("%COOKIE%", testCaseExecutionData.getValue1()));1276 res.setDescription(res.getDescription().replace("%PARAM%", testCaseExecutionData.getValue2()));1277 testCaseExecutionData.setPropertyResultMessage(res);1278 }1279 } else {1280 MessageEvent res = new MessageEvent(MessageEventEnum.PROPERTY_FAILED_GETFROMCOOKIE_PARAMETERNOTFOUND);1281 res.setDescription(res.getDescription().replace("%COOKIE%", testCaseExecutionData.getValue1()));1282 res.setDescription(res.getDescription().replace("%PARAM%", testCaseExecutionData.getValue2()));1283 testCaseExecutionData.setPropertyResultMessage(res);1284 }1285 } catch (Exception exception) {1286 LOG.debug(exception.toString());1287 MessageEvent res = new MessageEvent(MessageEventEnum.PROPERTY_FAILED_GETFROMCOOKIE_COOKIENOTFOUND);1288 res.setDescription(res.getDescription().replace("%COOKIE%", testCaseExecutionData.getValue1()));1289 res.setDescription(res.getDescription().replace("%PARAM%", testCaseExecutionData.getValue2()));1290 testCaseExecutionData.setPropertyResultMessage(res);1291 }1292 return testCaseExecutionData;1293 }1294 private TestCaseExecutionData property_getDifferencesFromXml(TestCaseExecutionData testCaseExecutionData, TestCaseExecution tCExecution, TestCaseCountryProperties testCaseCountryProperty, boolean forceCalculation) {1295 try {1296 LOG.debug("Computing differences between " + testCaseExecutionData.getValue1() + " and " + testCaseExecutionData.getValue2());1297 String differences = xmlUnitService.getDifferencesFromXml(testCaseExecutionData.getValue1(), testCaseExecutionData.getValue2());1298 if (differences != null) {1299 LOG.debug("Computing done.");1300 testCaseExecutionData.setValue(differences);1301 MessageEvent res = new MessageEvent(MessageEventEnum.PROPERTY_SUCCESS_GETDIFFERENCESFROMXML);1302 res.setDescription(res.getDescription().replace("%VALUE1%", testCaseExecutionData.getValue1()));1303 res.setDescription(res.getDescription().replace("%VALUE2%", testCaseExecutionData.getValue2()));1304 testCaseExecutionData.setPropertyResultMessage(res);1305 } else {1306 LOG.debug("Computing failed.");1307 MessageEvent res = new MessageEvent(MessageEventEnum.PROPERTY_FAILED_GETDIFFERENCESFROMXML);1308 res.setDescription(res.getDescription().replace("%VALUE1%", testCaseExecutionData.getValue1()));1309 res.setDescription(res.getDescription().replace("%VALUE2%", testCaseExecutionData.getValue2()));1310 testCaseExecutionData.setPropertyResultMessage(res);1311 }1312 } catch (Exception ex) {1313 LOG.debug(ex.toString());1314 MessageEvent res = new MessageEvent(MessageEventEnum.PROPERTY_FAILED_GETDIFFERENCESFROMXML);1315 res.setDescription(res.getDescription().replace("%VALUE1%", testCaseExecutionData.getValue1()));1316 res.setDescription(res.getDescription().replace("%VALUE2%", testCaseExecutionData.getValue2()));1317 testCaseExecutionData.setPropertyResultMessage(res);1318 }1319 return testCaseExecutionData;1320 }1321 private TestCaseExecutionData property_getFromJson(TestCaseExecutionData testCaseExecutionData, TestCaseExecution execution, boolean forceRecalculation) {1322 String jsonResponse = "";1323 if (null != execution.getLastServiceCalled()) {1324 jsonResponse = execution.getLastServiceCalled().getResponseHTTPBody();1325 }1326 if (!(StringUtil.isNullOrEmpty(testCaseExecutionData.getValue2()))) {1327 try {1328 jsonResponse = this.jsonService.callUrlAndGetJsonResponse(testCaseExecutionData.getValue2());1329 } catch (MalformedURLException e) {1330 LOG.debug("URL is invalid so we consider that it is a json file.");1331 jsonResponse = testCaseExecutionData.getValue2();1332 }1333 }1334 try {1335 //Record result in filessytem.1336 recorderService.recordProperty(execution.getId(), testCaseExecutionData.getProperty(), 1, jsonResponse, execution.getSecrets());1337 String valueFromJson = this1338 .jsonService1339 .getFromJson(jsonResponse, null, testCaseExecutionData.getValue1());1340 if (valueFromJson == null) {1341 throw new InvalidPathException();1342 }1343 testCaseExecutionData.setValue(valueFromJson);1344 MessageEvent res = new MessageEvent(MessageEventEnum.PROPERTY_SUCCESS_GETFROMJSON);1345 res.setDescription(res.getDescription().replace("%URL%", testCaseExecutionData.getValue2()));1346 res.setDescription(res.getDescription().replace("%PARAM%", testCaseExecutionData.getValue1()));1347 res.setDescription(res.getDescription().replace("%VALUE%", valueFromJson));1348 testCaseExecutionData.setPropertyResultMessage(res);1349 } catch (InvalidPathException exception) { //Path not found, invalid path syntax or empty path1350 MessageEvent res = new MessageEvent(MessageEventEnum.PROPERTY_FAILED_GETFROMJSON_PARAMETERNOTFOUND);1351 res.setDescription(res.getDescription().replace("%URL%", testCaseExecutionData.getValue2()));1352 res.setDescription(res.getDescription().replace("%PARAM%", testCaseExecutionData.getValue1()));1353 res.setDescription(res.getDescription().replace("%ERROR%", ""));1354 testCaseExecutionData.setPropertyResultMessage(res);1355 }1356 return testCaseExecutionData;1357 }1358 private TestCaseExecutionData property_getRawFromJson(TestCaseExecutionData testCaseExecutionData, TestCaseExecution execution) {1359 String jsonResponse = "";1360 //If tCExecution LastServiceCalled exist, get the response1361 if (execution.getLastServiceCalled() != null) {1362 jsonResponse = execution.getLastServiceCalled().getResponseHTTPBody();1363 }1364 if (!(StringUtil.isNullOrEmpty(testCaseExecutionData.getValue2()))) {1365 try {1366 jsonResponse = this.jsonService.callUrlAndGetJsonResponse(testCaseExecutionData.getValue2());1367 } catch (MalformedURLException e) {1368 LOG.debug("URL is invalid so we consider that it is a json file.");1369 jsonResponse = testCaseExecutionData.getValue2();1370 }1371 }1372 //Process...

Full Screen

Full Screen

property_getRawFromJson

Using AI Code Generation

copy

Full Screen

1importClass(Packages.org.cerberus.engine.entity.MessageEvent);2importClass(Packages.org.cerberus.engine.entity.MessageEventEnum);3importClass(Packages.org.cerberus.engine.entity.MessageGeneral);4importClass(Packages.org.cerberus.util.answer.AnswerItem);5importClass(Packages.org.cerberus.engine.entity.MessageGeneralEnum);6importClass(Packages.org.cerberus.engine.entity.MessageEvent);7importClass(Packages.org.cerberus.engine.entity.MessageEventEnum);8importClass(Packages.org.cerberus.engine.entity.MessageGeneral);9importClass(Packages.org.cerberus.util.answer.AnswerItem);10importClass(Packages.org.cerberus.engine.entity.MessageGeneralEnum);11importClass(Packages.org.cerberus.engine.execution.impl.TestService);12importClass(Packages.org.cerberus.engine.execution.impl.TestCaseExecutionService);13importClass(Packages.org.cerberus.engine.execution.impl.TestCaseStepActionExecutionService);14importClass(Packages.org.cerberus.engine.execution.impl.TestCaseStepExecutionService);15importClass(Packages.org.cerberus.engine.execution.impl.TestCaseStepActionControlExecutionService);16importClass(Packages.org.cerberus.engine.execution.impl.TestCaseStepActionControlExecutionFileService);17importClass(Packages.org.cerberus.engine.execution.impl.TestCaseStepActionControlExecutionManualService);18importClass(Packages.org.cerberus.engine.execution.impl.TestCaseStepActionControlExecutionService);19importClass(Packages.org.cerberus.engine.execution.impl.TestCaseStepActionExecutionService);20importClass(Packages.org.cerberus.engine.execution.impl.TestCaseStepExecutionService);21importClass(Packages.org.cerberus.engine.execution.impl.TestCaseExecutionService);22importClass(Packages.org.cerberus.engine.execution.impl.TestCaseExecutionQueueService);23importClass(Packages.org.cerberus.engine.execution.impl.TestCaseExecutionInQueueService);24importClass(Packages.org.cerberus.engine.execution.impl.TestCaseExecutionFileService);25importClass(Packages.org

Full Screen

Full Screen

property_getRawFromJson

Using AI Code Generation

copy

Full Screen

1var propertyService = require('org/cerberus/engine/gwt/impl/PropertyService.js');2var propertyServiceObject = new propertyService();3var propertyValue = propertyServiceObject.property_getRawFromJson("myProperty", "myJson");4var propertyService = require('org/cerberus/engine/gwt/impl/PropertyService.js');5var propertyServiceObject = new propertyService();6var propertyValue = propertyServiceObject.property_getRawFromJson("myProperty", "myJson");7property_getRawFromJson(String property, String json)8property_getRawFromJson(String property, String json)9property_getRawFromJson(String property, String json)10property_getRawFromJson(String property, String json)11property_getRawFromJson(String property, String json)12property_getRawFromJson(String property, String json)13property_getRawFromJson(String property, String json)14property_getRawFromJson(String property, String json)15property_getRawFromJson(String property, String json)

Full Screen

Full Screen

property_getRawFromJson

Using AI Code Generation

copy

Full Screen

1importClass(org.cerberus.engine.gwt.impl.PropertyService);2var propertyService = new PropertyService();3var property = propertyService.getProperty("myProperty");4var rawValue = propertyService.getRawFromJson(property);5log.info("Raw value of myProperty is: " + rawValue);6importClass(org.cerberus.engine.gwt.impl.PropertyService);7var propertyService = new PropertyService();8var property = propertyService.getProperty("myProperty");9var rawValue = propertyService.getRawFromJson(property);10log.info("Raw value of myProperty is: " + rawValue);11importClass(org.cerberus.engine.gwt.impl.PropertyService);12var propertyService = new PropertyService();13var property = propertyService.getProperty("myProperty");14var rawValue = propertyService.getRawFromJson(property);15log.info("Raw value of myProperty is: " + rawValue);16importClass(org.cerberus.engine.gwt.impl.PropertyService);17var propertyService = new PropertyService();18var property = propertyService.getProperty("myProperty");19var rawValue = propertyService.getRawFromJson(property);20log.info("Raw value of myProperty is: " + rawValue);21importClass(org.cerberus.engine.gwt.impl.PropertyService);22var propertyService = new PropertyService();23var property = propertyService.getProperty("myProperty");24var rawValue = propertyService.getRawFromJson(property);25log.info("Raw value of myProperty is: " + rawValue);26importClass(org.cerberus.engine.gwt.impl.PropertyService);27var propertyService = new PropertyService();28var property = propertyService.getProperty("myProperty");

Full Screen

Full Screen

property_getRawFromJson

Using AI Code Generation

copy

Full Screen

1if (this.Environment === "") {2 var propertyService = new org.cerberus.engine.gwt.impl.PropertyService();3 var property = propertyService.getProperty("Environment");4 var rawValue = propertyService.getRawFromJson(property.Value, this);5 this.Environment = rawValue;6}7if (this.Environment === "") {8 var propertyService = new org.cerberus.engine.gwt.impl.PropertyService();9 var property = propertyService.getProperty("Environment");10 var rawValue = propertyService.getRawFromJson(property.Value, this);11 this.Environment = rawValue;12}13if (this.Environment === "") {14 var propertyService = new org.cerberus.engine.gwt.impl.PropertyService();15 var property = propertyService.getProperty("Environment");16 var rawValue = propertyService.getRawFromJson(property.Value, this);

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful