Best Cerberus-source code snippet using org.cerberus.engine.gwt.impl.ActionService.waitTime
Source:ActionService.java
...775 } else if (identifier != null) {776 identifierService.checkWebElementIdentifier(identifier.getIdentifier());777 return webdriverService.doSeleniumActionWait(tCExecution.getSession(), identifier);778 } else {779 return this.waitTime(timeToWaitInMs);780 }781 } else { // For any other application we wait for the integer value.782 if (StringUtil.isNullOrEmpty(element)) {783 // Get default wait from parameter784 timeToWaitInMs = tCExecution.getCerberus_action_wait_default();785 } else if (StringUtil.isInteger(element)) {786 timeToWaitInMs = Long.valueOf(element);787 }788 return this.waitTime(timeToWaitInMs);789 }790 } catch (CerberusEventException ex) {791 LOG.fatal("Error doing Action Wait :" + ex);792 return ex.getMessageError();793 }794 }795 private MessageEvent doActionKeyPress(TestCaseExecution tCExecution, String value1, String value2) {796 try {797 String appType = tCExecution.getApplicationObj().getType();798 /**799 * Check object and property are not null For IPA and APK, only800 * value2 (key to press) is mandatory For GUI and FAT, both801 * parameters are mandatory802 */803// if (appType.equalsIgnoreCase(Application.TYPE_APK) || appType.equalsIgnoreCase(Application.TYPE_IPA)) {804 if (StringUtil.isNullOrEmpty(value2)) {805 return new MessageEvent(MessageEventEnum.ACTION_FAILED_KEYPRESS_MISSINGKEY).resolveDescription("APPLICATIONTYPE", appType);806 }807// } else if (appType.equalsIgnoreCase(Application.TYPE_GUI) || appType.equalsIgnoreCase(Application.TYPE_FAT)) {808// if (StringUtil.isNullOrEmpty(value1) || StringUtil.isNullOrEmpty(value2)) {809// return new MessageEvent(MessageEventEnum.ACTION_FAILED_KEYPRESS);810// }811// }812 /**813 * Get Identifier (identifier, locator)814 */815 Identifier objectIdentifier = identifierService.convertStringToIdentifier(value1);816 if (appType.equalsIgnoreCase(Application.TYPE_GUI)) {817 if (objectIdentifier.getIdentifier().equals(SikuliService.SIKULI_IDENTIFIER_PICTURE)) {818 return sikuliService.doSikuliActionKeyPress(tCExecution.getSession(), objectIdentifier.getLocator(), value2);819 } else {820 identifierService.checkWebElementIdentifier(objectIdentifier.getIdentifier());821 return webdriverService.doSeleniumActionKeyPress(tCExecution.getSession(), objectIdentifier, value2);822 }823 } else if (appType.equalsIgnoreCase(Application.TYPE_APK)) {824 return androidAppiumService.keyPress(tCExecution.getSession(), value2);825 } else if (appType.equalsIgnoreCase(Application.TYPE_IPA)) {826 return iosAppiumService.keyPress(tCExecution.getSession(), value2);827 } else if (appType.equalsIgnoreCase(Application.TYPE_FAT)) {828 return sikuliService.doSikuliActionKeyPress(tCExecution.getSession(), objectIdentifier.getLocator(), value2);829 } else {830 return new MessageEvent(MessageEventEnum.ACTION_NOTEXECUTED_NOTSUPPORTED_FOR_APPLICATION)831 .resolveDescription("ACTION", "KeyPress")832 .resolveDescription("APPLICATIONTYPE", appType);833 }834 } catch (CerberusEventException ex) {835 LOG.fatal("Error doing Action KeyPress :" + ex);836 return ex.getMessageError();837 }838 }839 private MessageEvent doActionOpenURL(TestCaseExecution tCExecution, String object, String property, boolean withBase) {840 MessageEvent message;841 String element;842 try {843 /**844 * Get element to use String object if not empty, String property if845 * object empty, throws Exception if both empty)846 */847 element = getElementToUse(object, property, "openUrl[WithBase]", tCExecution);848 /**849 * Get Identifier (identifier, locator)850 */851 Identifier identifier = new Identifier();852 identifier.setIdentifier("url");853 identifier.setLocator(element);854 if (tCExecution.getApplicationObj().getType().equalsIgnoreCase(Application.TYPE_GUI)) {855 return webdriverService.doSeleniumActionOpenURL(tCExecution.getSession(), tCExecution.getUrl(), identifier, withBase);856 }857 message = new MessageEvent(MessageEventEnum.ACTION_NOTEXECUTED_NOTSUPPORTED_FOR_APPLICATION);858 message.setDescription(message.getDescription().replace("%ACTION%", "OpenURL[WithBase]"));859 message.setDescription(message.getDescription().replace("%APPLICATIONTYPE%", tCExecution.getApplicationObj().getType()));860 return message;861 } catch (CerberusEventException ex) {862 LOG.fatal("Error doing Action OpenUrl :" + ex);863 return ex.getMessageError();864 }865 }866 private MessageEvent doActionOpenApp(TestCaseExecution tCExecution, String value1) {867 MessageEvent message;868 /**869 * Check value1 is not null or empty870 */871 if (value1 == null || "".equals(value1)) {872 return new MessageEvent(MessageEventEnum.ACTION_FAILED_OPENAPP);873 }874 if (tCExecution.getApplicationObj().getType().equalsIgnoreCase(Application.TYPE_FAT)875 || tCExecution.getApplicationObj().getType().equalsIgnoreCase(Application.TYPE_GUI)) {876 return sikuliService.doSikuliActionOpenApp(tCExecution.getSession(), value1);877 }878 message = new MessageEvent(MessageEventEnum.ACTION_NOTEXECUTED_NOTSUPPORTED_FOR_APPLICATION);879 message.setDescription(message.getDescription().replace("%ACTION%", "OpenApp"));880 message.setDescription(message.getDescription().replace("%APPLICATIONTYPE%", tCExecution.getApplicationObj().getType()));881 return message;882 }883 private MessageEvent doActionCloseApp(TestCaseExecution tCExecution, String value1) {884 MessageEvent message;885 /**886 * Check value1 is not null or empty887 */888 if (value1 == null || "".equals(value1)) {889 return new MessageEvent(MessageEventEnum.ACTION_FAILED_CLOSEAPP);890 }891 if (tCExecution.getApplicationObj().getType().equalsIgnoreCase(Application.TYPE_FAT)892 || tCExecution.getApplicationObj().getType().equalsIgnoreCase(Application.TYPE_GUI)) {893 return sikuliService.doSikuliActionCloseApp(tCExecution.getSession(), value1);894 }895 message = new MessageEvent(MessageEventEnum.ACTION_NOTEXECUTED_NOTSUPPORTED_FOR_APPLICATION);896 message.setDescription(message.getDescription().replace("%ACTION%", "CloseApp"));897 message.setDescription(message.getDescription().replace("%APPLICATIONTYPE%", tCExecution.getApplicationObj().getType()));898 return message;899 }900 private MessageEvent doActionWaitVanish(TestCaseExecution tCExecution, String value1) {901 try {902 /**903 * Check value1 is not null or empty904 */905 if (value1 == null || "".equals(value1)) {906 return new MessageEvent(MessageEventEnum.ACTION_FAILED_CLOSEAPP);907 }908 /**909 * Get Identifier (identifier, locator)910 */911 Identifier identifier = identifierService.convertStringToIdentifier(value1);912 if (tCExecution.getApplicationObj().getType().equalsIgnoreCase(Application.TYPE_GUI)) {913 if (identifier.getIdentifier().equals(SikuliService.SIKULI_IDENTIFIER_PICTURE)) {914 return sikuliService.doSikuliActionWaitVanish(tCExecution.getSession(), identifier.getLocator(), "");915 } else if (identifier.getIdentifier().equals(SikuliService.SIKULI_IDENTIFIER_TEXT)) {916 return sikuliService.doSikuliActionWaitVanish(tCExecution.getSession(), "", identifier.getLocator());917 } else {918 identifierService.checkWebElementIdentifier(identifier.getIdentifier());919 return webdriverService.doSeleniumActionWaitVanish(tCExecution.getSession(), identifier);920 }921 } else if (tCExecution.getApplicationObj().getType().equalsIgnoreCase(Application.TYPE_APK)922 || tCExecution.getApplicationObj().getType().equalsIgnoreCase(Application.TYPE_IPA)) {923 identifierService.checkWebElementIdentifier(identifier.getIdentifier());924 return webdriverService.doSeleniumActionWaitVanish(tCExecution.getSession(), identifier);925 } else if (tCExecution.getApplicationObj().getType().equalsIgnoreCase(Application.TYPE_FAT)) {926 identifierService.checkSikuliIdentifier(identifier.getIdentifier());927 if (identifier.getIdentifier().equals(SikuliService.SIKULI_IDENTIFIER_PICTURE)) {928 return sikuliService.doSikuliActionWaitVanish(tCExecution.getSession(), identifier.getLocator(), "");929 } else {930 return sikuliService.doSikuliActionWaitVanish(tCExecution.getSession(), "", identifier.getLocator());931 }932 } else {933 return new MessageEvent(MessageEventEnum.ACTION_NOTEXECUTED_NOTSUPPORTED_FOR_APPLICATION)934 .resolveDescription("ACTION", "WaitVanish")935 .resolveDescription("APPLICATIONTYPE", tCExecution.getApplicationObj().getType());936 }937 } catch (CerberusEventException ex) {938 LOG.fatal("Error doing Action KeyPress :" + ex);939 return ex.getMessageError();940 }941 }942 private MessageEvent doActionSelect(TestCaseExecution tCExecution, String value1, String value2) {943 MessageEvent message;944 try {945 /**946 * Check object and property are not null947 */948 if (StringUtil.isNullOrEmpty(value1) || StringUtil.isNullOrEmpty(value2)) {949 return new MessageEvent(MessageEventEnum.ACTION_FAILED_SELECT);950 }951 /**952 * Get Identifier (identifier, locator)953 */954 Identifier identifierObject = identifierService.convertStringToIdentifier(value1);955 Identifier identifierValue = identifierService.convertStringToSelectIdentifier(value2);956 identifierService.checkWebElementIdentifier(identifierObject.getIdentifier());957 identifierService.checkSelectOptionsIdentifier(identifierValue.getIdentifier());958 if (tCExecution.getApplicationObj().getType().equalsIgnoreCase(Application.TYPE_GUI)959 || tCExecution.getApplicationObj().getType().equalsIgnoreCase(Application.TYPE_APK)960 || tCExecution.getApplicationObj().getType().equalsIgnoreCase(Application.TYPE_IPA)) {961 return webdriverService.doSeleniumActionSelect(tCExecution.getSession(), identifierObject, identifierValue);962 }963 message = new MessageEvent(MessageEventEnum.ACTION_NOTEXECUTED_NOTSUPPORTED_FOR_APPLICATION);964 message.setDescription(message.getDescription().replace("%ACTION%", "Select"));965 message.setDescription(message.getDescription().replace("%APPLICATIONTYPE%", tCExecution.getApplicationObj().getType()));966 return message;967 } catch (CerberusEventException ex) {968 LOG.fatal("Error doing Action Select :" + ex);969 return ex.getMessageError();970 }971 }972 private MessageEvent doActionUrlLogin(TestCaseExecution tCExecution) {973 MessageEvent message;974 if (tCExecution.getApplicationObj().getType().equalsIgnoreCase(Application.TYPE_GUI)) {975 return webdriverService.doSeleniumActionUrlLogin(tCExecution.getSession(), tCExecution.getUrl(), tCExecution.getCountryEnvironmentParameters().getUrlLogin());976 }977 message = new MessageEvent(MessageEventEnum.ACTION_NOTEXECUTED_NOTSUPPORTED_FOR_APPLICATION);978 message.setDescription(message.getDescription().replace("%ACTION%", "UrlLogin"));979 message.setDescription(message.getDescription().replace("%APPLICATIONTYPE%", tCExecution.getApplicationObj().getType()));980 return message;981 }982 private MessageEvent doActionFocusToIframe(TestCaseExecution tCExecution, String object, String property) {983 MessageEvent message;984 String element;985 try {986 /**987 * Get element to use String object if not empty, String property if988 * object empty, throws Exception if both empty)989 */990 element = getElementToUse(object, property, "focusToIframe", tCExecution);991 /**992 * Get Identifier (identifier, locator)993 */994 Identifier identifier = identifierService.convertStringToIdentifier(element);995 identifierService.checkWebElementIdentifier(identifier.getIdentifier());996 if (tCExecution.getApplicationObj().getType().equalsIgnoreCase(Application.TYPE_GUI)) {997 return webdriverService.doSeleniumActionFocusToIframe(tCExecution.getSession(), identifier);998 }999 message = new MessageEvent(MessageEventEnum.ACTION_NOTEXECUTED_NOTSUPPORTED_FOR_APPLICATION);1000 message.setDescription(message.getDescription().replace("%ACTION%", "FocusToIframe"));1001 message.setDescription(message.getDescription().replace("%APPLICATIONTYPE%", tCExecution.getApplicationObj().getType()));1002 return message;1003 } catch (CerberusEventException ex) {1004 LOG.fatal("Error doing Action FocusToIframe :" + ex);1005 return ex.getMessageError();1006 }1007 }1008 private MessageEvent doActionFocusDefaultIframe(TestCaseExecution tCExecution) {1009 MessageEvent message;1010 if (tCExecution.getApplicationObj().getType().equalsIgnoreCase(Application.TYPE_GUI)) {1011 return webdriverService.doSeleniumActionFocusDefaultIframe(tCExecution.getSession());1012 }1013 message = new MessageEvent(MessageEventEnum.ACTION_NOTEXECUTED_NOTSUPPORTED_FOR_APPLICATION);1014 message.setDescription(message.getDescription().replace("%ACTION%", "FocusDefaultIframe"));1015 message.setDescription(message.getDescription().replace("%APPLICATIONTYPE%", tCExecution.getApplicationObj().getType()));1016 return message;1017 }1018 private MessageEvent doActionCallService(TestCaseStepActionExecution testCaseStepActionExecution, String value1) {1019 MessageEvent message = new MessageEvent(MessageEventEnum.ACTION_FAILED_CALLSERVICE);1020 TestCaseExecution tCExecution = testCaseStepActionExecution.getTestCaseStepExecution().gettCExecution();1021 AnswerItem lastServiceCalledAnswer;1022 lastServiceCalledAnswer = serviceService.callService(value1, null, null, null, null, tCExecution);1023 message = lastServiceCalledAnswer.getResultMessage();1024 if (lastServiceCalledAnswer.getItem() != null) {1025 AppService lastServiceCalled = (AppService) lastServiceCalledAnswer.getItem();1026 tCExecution.setLastServiceCalled(lastServiceCalled);1027 /**1028 * Record the Request and Response in filesystem.1029 */1030 testCaseStepActionExecution.addFileList(recorderService.recordServiceCall(tCExecution, testCaseStepActionExecution, 0, null, lastServiceCalled));1031 }1032 return message;1033 }1034 private MessageEvent doActionTakeScreenshot(TestCaseStepActionExecution testCaseStepActionExecution) {1035 MessageEvent message;1036 if (testCaseStepActionExecution.getTestCaseStepExecution().gettCExecution().getApplicationObj().getType().equalsIgnoreCase(Application.TYPE_GUI)1037 || testCaseStepActionExecution.getTestCaseStepExecution().gettCExecution().getApplicationObj().getType().equalsIgnoreCase(Application.TYPE_APK)1038 || testCaseStepActionExecution.getTestCaseStepExecution().gettCExecution().getApplicationObj().getType().equalsIgnoreCase(Application.TYPE_IPA)) {1039 recorderService.recordScreenshot(testCaseStepActionExecution.getTestCaseStepExecution().gettCExecution(),1040 testCaseStepActionExecution, 0);1041 message = new MessageEvent(MessageEventEnum.ACTION_SUCCESS_TAKESCREENSHOT);1042 return message;1043 } else if (testCaseStepActionExecution.getTestCaseStepExecution().gettCExecution().getApplicationObj().getType().equalsIgnoreCase(Application.TYPE_FAT)) {1044 /**1045 * TODO Implement screenshot for FAT client application1046 */1047 message = new MessageEvent(MessageEventEnum.ACTION_NOTEXECUTED_NOTSUPPORTED_FOR_APPLICATION);1048 }1049 message = new MessageEvent(MessageEventEnum.ACTION_NOTEXECUTED_NOTSUPPORTED_FOR_APPLICATION);1050 message.setDescription(message.getDescription().replace("%ACTION%", "TakeScreenShot"));1051 message.setDescription(message.getDescription().replace("%APPLICATIONTYPE%", testCaseStepActionExecution.getTestCaseStepExecution().gettCExecution().getApplicationObj().getType()));1052 return message;1053 }1054 private MessageEvent doActionGetPageSource(TestCaseStepActionExecution testCaseStepActionExecution) {1055 MessageEvent message;1056 if (testCaseStepActionExecution.getTestCaseStepExecution().gettCExecution().getApplicationObj().getType().equalsIgnoreCase(Application.TYPE_GUI)1057 || testCaseStepActionExecution.getTestCaseStepExecution().gettCExecution().getApplicationObj().getType().equalsIgnoreCase(Application.TYPE_APK)1058 || testCaseStepActionExecution.getTestCaseStepExecution().gettCExecution().getApplicationObj().getType().equalsIgnoreCase(Application.TYPE_IPA)) {1059 recorderService.recordPageSource(testCaseStepActionExecution.getTestCaseStepExecution().gettCExecution(), testCaseStepActionExecution, 0);1060 message = new MessageEvent(MessageEventEnum.ACTION_SUCCESS_GETPAGESOURCE);1061 return message;1062 }1063 message = new MessageEvent(MessageEventEnum.ACTION_NOTEXECUTED_NOTSUPPORTED_FOR_APPLICATION);1064 message.setDescription(message.getDescription().replace("%ACTION%", "getPageSource"));1065 message.setDescription(message.getDescription().replace("%APPLICATIONTYPE%", testCaseStepActionExecution.getTestCaseStepExecution().gettCExecution().getApplicationObj().getType()));1066 return message;1067 }1068 private MessageEvent doActionRemoveDifference(TestCaseStepActionExecution testCaseStepActionExecution, String object, String property) {1069 // Filters differences from the given object pattern1070 String filteredDifferences = xmlUnitService.removeDifference(object, property);1071 // If filtered differences are null then service has returned with errors1072 if (filteredDifferences == null) {1073 MessageEvent message = new MessageEvent(MessageEventEnum.ACTION_FAILED_REMOVEDIFFERENCE);1074 message.setDescription(message.getDescription().replace("%DIFFERENCE%", object));1075 message.setDescription(message.getDescription().replace("%DIFFERENCES%", property));1076 return message;1077 }1078 // Sets the property value to the new filtered one1079 for (TestCaseExecutionData data : testCaseStepActionExecution.getTestCaseExecutionDataList()) {1080 if (data.getProperty().equals(testCaseStepActionExecution.getPropertyName())) {1081 data.setValue(filteredDifferences);1082 break;1083 }1084 }1085 // Sends success1086 MessageEvent message = new MessageEvent(MessageEventEnum.ACTION_SUCCESS_REMOVEDIFFERENCE);1087 message.setDescription(message.getDescription().replace("%DIFFERENCE%", object));1088 message.setDescription(message.getDescription().replace("%DIFFERENCES%", property));1089 return message;1090 }1091 private MessageEvent doActionCalculateProperty(TestCaseStepActionExecution testCaseStepActionExecution, String value1, String value2) {1092 MessageEvent message;1093 AnswerItem<String> answerDecode = new AnswerItem();1094 if (StringUtil.isNullOrEmpty(value1)) {1095 // Value1 is a mandatory parameter.1096 message = new MessageEvent(MessageEventEnum.ACTION_FAILED_CALCULATEPROPERTY_MISSINGPROPERTY);1097 message.setDescription(message.getDescription().replace("%ACTION%", TestCaseStepAction.ACTION_CALCULATEPROPERTY));1098 } else {1099 try {1100 TestCaseExecution tCExecution = testCaseStepActionExecution.getTestCaseStepExecution().gettCExecution();1101 // Getting the Country property definition.1102 TestCaseCountryProperties tccp = null;1103 boolean propertyExistOnAnyCountry = false;1104 for (TestCaseCountryProperties object : tCExecution.getTestCaseCountryPropertyList()) {1105 if ((object.getProperty().equalsIgnoreCase(value1)) && (object.getCountry().equalsIgnoreCase(tCExecution.getCountry()))) {1106 tccp = object;1107 }1108 if ((object.getProperty().equalsIgnoreCase(value1))) {1109 propertyExistOnAnyCountry = true;1110 }1111 }1112 if (tccp == null) { // Could not find a country property inside the existing execution.1113 if (propertyExistOnAnyCountry) {1114 message = new MessageEvent(MessageEventEnum.ACTION_NOTEXECUTED_NO_PROPERTY_DEFINITION);1115 message.setDescription(message.getDescription().replace("%ACTION%", TestCaseStepAction.ACTION_CALCULATEPROPERTY)1116 .replace("%PROP%", value1)1117 .replace("%COUNTRY%", tCExecution.getCountry()));1118 return message;1119 } else {1120 message = new MessageEvent(MessageEventEnum.ACTION_FAILED_CALCULATEPROPERTY_PROPERTYNOTFOUND);1121 message.setDescription(message.getDescription().replace("%ACTION%", TestCaseStepAction.ACTION_CALCULATEPROPERTY)1122 .replace("%PROP%", value1)1123 .replace("%COUNTRY%", tCExecution.getCountry()));1124 return message;1125 }1126 } else {1127 if (!(StringUtil.isNullOrEmpty(value2))) {1128 // If value2 is fed with something, we control here that value is a valid property name and gets its defintion.1129 tccp = null;1130 propertyExistOnAnyCountry = false;1131 for (TestCaseCountryProperties object : tCExecution.getTestCaseCountryPropertyList()) {1132 if ((object.getProperty().equalsIgnoreCase(value2)) && (object.getCountry().equalsIgnoreCase(tCExecution.getCountry()))) {1133 tccp = object;1134 }1135 if ((object.getProperty().equalsIgnoreCase(value2))) {1136 propertyExistOnAnyCountry = true;1137 }1138 }1139 if (tccp == null) { // Could not find a country property inside the existing execution.1140 if (propertyExistOnAnyCountry) {1141 message = new MessageEvent(MessageEventEnum.ACTION_NOTEXECUTED_NO_PROPERTY_DEFINITION);1142 message.setDescription(message.getDescription().replace("%ACTION%", TestCaseStepAction.ACTION_CALCULATEPROPERTY)1143 .replace("%PROP%", value2)1144 .replace("%COUNTRY%", tCExecution.getCountry()));1145 return message;1146 } else {1147 message = new MessageEvent(MessageEventEnum.ACTION_FAILED_CALCULATEPROPERTY_PROPERTYNOTFOUND);1148 message.setDescription(message.getDescription().replace("%ACTION%", TestCaseStepAction.ACTION_CALCULATEPROPERTY)1149 .replace("%PROP%", value2)1150 .replace("%COUNTRY%", tCExecution.getCountry()));1151 return message;1152 }1153 }1154 }1155 // We calculate the property here.1156 long now = new Date().getTime();1157 TestCaseExecutionData tcExeData;1158 tcExeData = factoryTestCaseExecutionData.create(tCExecution.getId(), tccp.getProperty(), 1, tccp.getDescription(), null, tccp.getType(),1159 tccp.getValue1(), tccp.getValue2(), null, null, now, now, now, now, new MessageEvent(MessageEventEnum.PROPERTY_PENDING),1160 tccp.getRetryNb(), tccp.getRetryPeriod(), tccp.getDatabase(), tccp.getValue1(), tccp.getValue2(), tccp.getLength(), tccp.getLength(),1161 tccp.getRowLimit(), tccp.getNature(), "", "", "", "", "", "N");1162 tcExeData.setTestCaseCountryProperties(tccp);1163 propertyService.calculateProperty(tcExeData, tCExecution, testCaseStepActionExecution, tccp, true);1164 // Property message goes to Action message.1165 message = tcExeData.getPropertyResultMessage();1166 if (message.getCodeString().equals("OK")) {1167 // If Property calculated successfully we summarize the message to a shorter version.1168 message = new MessageEvent(MessageEventEnum.ACTION_SUCCESS_CALCULATEPROPERTY);1169 message.setDescription(message.getDescription()1170 .replace("%PROP%", value1)1171 .replace("%VALUE%", tcExeData.getValue()));1172 if (tcExeData.getDataLibRawData() != null) {1173 message.setDescription(message.getDescription() + " %NBROWS% row(s) with %NBSUBDATA% Subdata(s) calculated."1174 .replace("%NBROWS%", String.valueOf(tcExeData.getDataLibRawData().size()))1175 .replace("%NBSUBDATA%", String.valueOf(tcExeData.getDataLibRawData().get(0).size())));1176 }1177 }1178 if (!(StringUtil.isNullOrEmpty(value2))) {1179 // If value2 is fed we force the result to value1.1180 tcExeData.setProperty(value1);1181 }1182 //saves the result 1183 try {1184 testCaseExecutionDataService.convert(testCaseExecutionDataService.save(tcExeData));1185 LOG.debug("Adding into Execution data list. Property : '" + tcExeData.getProperty() + "' Index : '" + tcExeData.getIndex() + "' Value : '" + tcExeData.getValue() + "'");1186 tCExecution.getTestCaseExecutionDataMap().put(tcExeData.getProperty(), tcExeData);1187 if (tcExeData.getDataLibRawData() != null) { // If the property is a TestDataLib, we same all rows retreived in order to support nature such as NOTINUSe or RANDOMNEW.1188 for (int i = 1; i < (tcExeData.getDataLibRawData().size()); i++) {1189 now = new Date().getTime();1190 TestCaseExecutionData tcedS = factoryTestCaseExecutionData.create(tcExeData.getId(), tcExeData.getProperty(), (i + 1),1191 tcExeData.getDescription(), tcExeData.getDataLibRawData().get(i).get(""), tcExeData.getType(), "", "",1192 tcExeData.getRC(), "", now, now, now, now, null, 0, 0, "", "", "", "", "", 0, "", "", "", "", "", "", "N");1193 testCaseExecutionDataService.convert(testCaseExecutionDataService.save(tcedS));1194 }1195 }1196 } catch (CerberusException cex) {1197 LOG.error(cex.getMessage(), cex);1198 }1199 }1200 } catch (Exception ex) {1201 LOG.error(ex.toString(), ex);1202 message = new MessageEvent(MessageEventEnum.ACTION_FAILED_GENERIC).resolveDescription("DETAIL", ex.toString());1203 }1204 }1205 return message;1206 }1207 private String getElementToUse(String value1, String value2, String action, TestCaseExecution tCExecution) throws CerberusEventException {1208 if (!StringUtil.isNullOrEmpty(value1)) {1209 return value1;1210 } else if (!StringUtil.isNullOrEmpty(value2)) {1211 logEventService.createForPrivateCalls("ENGINE", action, MESSAGE_DEPRECATED + " Beware, in future release, it won't be allowed to use action without using field value1. Triggered by TestCase : ['" + tCExecution.getTest() + "'|'" + tCExecution.getTestCase() + "'] Property : " + value2);1212 LOG.warn(MESSAGE_DEPRECATED + " Action : " + action + ". Beware, in future release, it won't be allowed to use action without using field value1. Triggered by TestCase : ['" + tCExecution.getTest() + "'|'" + tCExecution.getTestCase() + "'] Property : " + value2);1213 return value2;1214 }1215 if (!(action.equals("wait"))) { // Wait is the only action can be excuted with no parameters. For all other actions we raize an exception as this should never happen.1216 MessageEvent message = new MessageEvent(MessageEventEnum.ACTION_FAILED_NO_ELEMENT_TO_PERFORM_ACTION);1217 message.setDescription(message.getDescription().replace("%ACTION%", action));1218 throw new CerberusEventException(message);1219 }1220 return null;1221 }1222 private MessageEvent waitTime(Long timeToWaitMs) {1223 MessageEvent message;1224 /**1225 * if timeToWait is null, throw CerberusException1226 */1227 if (timeToWaitMs == 0) {1228 message = new MessageEvent(MessageEventEnum.ACTION_FAILED_WAIT_INVALID_FORMAT);1229 return message;1230 }1231 try {1232 LOG.debug("TIME TO WAIT = " + timeToWaitMs);1233 Thread.sleep(timeToWaitMs);1234 message = new MessageEvent(MessageEventEnum.ACTION_SUCCESS_WAIT_TIME);1235 message.setDescription(message.getDescription().replace("%TIME%", String.valueOf(timeToWaitMs)));1236 return message;...
waitTime
Using AI Code Generation
1org.cerberus.engine.gwt.impl.ActionService.waitTime(5000);2org.cerberus.engine.gwt.impl.ActionService.waitTime(10000);3org.cerberus.engine.gwt.impl.ActionService.waitTime(15000);4org.cerberus.engine.gwt.impl.ActionService.waitTime(20000);5org.cerberus.engine.gwt.impl.ActionService.waitTime(25000);6org.cerberus.engine.gwt.impl.ActionService.waitTime(30000);7org.cerberus.engine.gwt.impl.ActionService.waitTime(35000);8org.cerberus.engine.gwt.impl.ActionService.waitTime(40000);9org.cerberus.engine.gwt.impl.ActionService.waitTime(45000);10org.cerberus.engine.gwt.impl.ActionService.waitTime(50000);11org.cerberus.engine.gwt.impl.ActionService.waitTime(55000);12org.cerberus.engine.gwt.impl.ActionService.waitTime(60000);13org.cerberus.engine.gwt.impl.ActionService.waitTime(65000);14org.cerberus.engine.gwt.impl.ActionService.waitTime(70000);15org.cerberus.engine.gwt.impl.ActionService.waitTime(75000);16org.cerberus.engine.gwt.impl.ActionService.waitTime(80000);17org.cerberus.engine.gwt.impl.ActionService.waitTime(85000);18org.cerberus.engine.gwt.impl.ActionService.waitTime(90000);19org.cerberus.engine.gwt.impl.ActionService.waitTime(95000);20org.cerberus.engine.gwt.impl.ActionService.waitTime(100000);21org.cerberus.engine.gwt.impl.ActionService.waitTime(105000);
waitTime
Using AI Code Generation
1waitTime(5, "s")2waitTime(10, "m")3waitTime(1, "h")4waitTime(2, "d")5waitTime(500, "ms")6waitTime(5, "s")7waitTime(10, "m")8waitTime(1, "h")9waitTime(2, "d")10waitTime(500, "ms")11waitTime(5, "s")12waitTime(10, "m")13waitTime(1, "h")14waitTime(2, "d")15waitTime(500, "ms")
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.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!