How to use getValue3 method of org.cerberus.crud.entity.TestCaseStepActionExecution class

Best Cerberus-source code snippet using org.cerberus.crud.entity.TestCaseStepActionExecution.getValue3

Source:ExecutionRunService.java Github

copy

Full Screen

...943 testCaseStepExecution.getId(), testCaseStepAction.getTest(), testCaseStepAction.getTestCase(),944 testCaseStepAction.getStep(), testCaseStepExecution.getIndex(), testCaseStepAction.getSequence(), testCaseStepAction.getSort(), null, null,945 testCaseStepAction.getConditionOper(), testCaseStepAction.getConditionVal1(), testCaseStepAction.getConditionVal2(), testCaseStepAction.getConditionVal3(),946 testCaseStepAction.getConditionVal1(), testCaseStepAction.getConditionVal2(), testCaseStepAction.getConditionVal3(),947 testCaseStepAction.getAction(), testCaseStepAction.getValue1(), testCaseStepAction.getValue2(), testCaseStepAction.getValue3(), testCaseStepAction.getValue1(),948 testCaseStepAction.getValue2(), testCaseStepAction.getValue3(),949 testCaseStepAction.getForceExeStatus(), startAction, 0, startAction, 0, new MessageEvent(MessageEventEnum.ACTION_PENDING),950 testCaseStepAction.getDescription(), testCaseStepAction, testCaseStepExecution);951 this.testCaseStepActionExecutionService.insertTestCaseStepActionExecution(testCaseStepActionExecution);952 /**953 * We populate the TestCase Action List954 */955 testCaseStepExecution.addTestCaseStepActionExecutionList(testCaseStepActionExecution);956 /**957 * If execution is not manual, evaluate the condition at the action958 * level959 */960 AnswerItem<Boolean> conditionAnswer;961 boolean conditionDecodeError = false;962 if (!tcExecution.getManualExecution().equals("Y")) {963 try {964 answerDecode = variableService.decodeStringCompletly(testCaseStepActionExecution.getConditionVal1(), tcExecution, null, false);965 testCaseStepActionExecution.setConditionVal1((String) answerDecode.getItem());966 if (!(answerDecode.isCodeStringEquals("OK"))) {967 // If anything wrong with the decode --> we stop here with decode message in the action result.968 testCaseStepActionExecution.setActionResultMessage(answerDecode.getResultMessage().resolveDescription("FIELD", "Action Condition Value1"));969 testCaseStepActionExecution.setExecutionResultMessage(new MessageGeneral(answerDecode.getResultMessage().getMessage()));970 testCaseStepActionExecution.setStopExecution(answerDecode.getResultMessage().isStopTest());971 testCaseStepActionExecution.setEnd(new Date().getTime());972 LOG.debug("Action interupted due to decode 'Action Condition Value1' Error.");973 conditionDecodeError = true;974 }975 } catch (CerberusEventException cex) {976 LOG.warn(cex);977 }978 try {979 answerDecode = variableService.decodeStringCompletly(testCaseStepActionExecution.getConditionVal2(), tcExecution, null, false);980 testCaseStepActionExecution.setConditionVal2((String) answerDecode.getItem());981 if (!(answerDecode.isCodeStringEquals("OK"))) {982 // If anything wrong with the decode --> we stop here with decode message in the action result.983 testCaseStepActionExecution.setActionResultMessage(answerDecode.getResultMessage().resolveDescription("FIELD", "Action Condition Value2"));984 testCaseStepActionExecution.setExecutionResultMessage(new MessageGeneral(answerDecode.getResultMessage().getMessage()));985 testCaseStepActionExecution.setStopExecution(answerDecode.getResultMessage().isStopTest());986 testCaseStepActionExecution.setEnd(new Date().getTime());987 LOG.debug("Action interupted due to decode 'Action Condition Value2' Error.");988 conditionDecodeError = true;989 }990 } catch (CerberusEventException cex) {991 LOG.warn(cex);992 }993 try {994 answerDecode = variableService.decodeStringCompletly(testCaseStepActionExecution.getConditionVal3(), tcExecution, null, false);995 testCaseStepActionExecution.setConditionVal3((String) answerDecode.getItem());996 if (!(answerDecode.isCodeStringEquals("OK"))) {997 // If anything wrong with the decode --> we stop here with decode message in the action result.998 testCaseStepActionExecution.setActionResultMessage(answerDecode.getResultMessage().resolveDescription("FIELD", "Action Condition Value3"));999 testCaseStepActionExecution.setExecutionResultMessage(new MessageGeneral(answerDecode.getResultMessage().getMessage()));1000 testCaseStepActionExecution.setStopExecution(answerDecode.getResultMessage().isStopTest());1001 testCaseStepActionExecution.setEnd(new Date().getTime());1002 LOG.debug("Action interupted due to decode 'Action Condition Value3' Error.");1003 conditionDecodeError = true;1004 }1005 } catch (CerberusEventException cex) {1006 LOG.warn(cex);1007 }1008 }1009 if (!(conditionDecodeError)) {1010 conditionAnswer = this.conditionService.evaluateCondition(testCaseStepActionExecution.getConditionOper(), testCaseStepActionExecution.getConditionVal1(), testCaseStepActionExecution.getConditionVal2(), testCaseStepActionExecution.getConditionVal3(), tcExecution);1011 boolean execute_Action = (boolean) conditionAnswer.getItem();1012 /**1013 * If condition OK or if manual execution, then execute the1014 * action1015 */1016 if (conditionAnswer.getResultMessage().getMessage().getCodeString().equals("PE")1017 || tcExecution.getManualExecution().equals("Y")) {1018 // Execute or not the action here.1019 if (execute_Action || tcExecution.getManualExecution().equals("Y")) {1020 LOG.debug("Executing action : " + testCaseStepActionExecution.getAction() + " with val1 : " + testCaseStepActionExecution.getValue1()1021 + " and val2 : " + testCaseStepActionExecution.getValue2()1022 + " and val3 : " + testCaseStepActionExecution.getValue3());1023 /**1024 * We execute the Action1025 */1026 testCaseStepActionExecution = this.executeAction(testCaseStepActionExecution, tcExecution);1027 /**1028 * If Action or property reported to stop the testcase,1029 * we stop it and update the step with the message.1030 */1031 testCaseStepExecution.setStopExecution(testCaseStepActionExecution.isStopExecution());1032 if ((!(testCaseStepActionExecution.getExecutionResultMessage().equals(new MessageGeneral(MessageGeneralEnum.EXECUTION_OK))))1033 && (!(testCaseStepActionExecution.getExecutionResultMessage().equals(new MessageGeneral(MessageGeneralEnum.EXECUTION_PE_TESTEXECUTING))))) {1034 testCaseStepExecution.setExecutionResultMessage(testCaseStepActionExecution.getExecutionResultMessage());1035 testCaseStepExecution.setStepResultMessage(testCaseStepActionExecution.getActionResultMessage());1036 }1037 if (testCaseStepActionExecution.isStopExecution()) {1038 break;1039 }1040 } else { // We don't execute the action and record a generic execution.1041 /**1042 * Record Screenshot, PageSource1043 */1044 testCaseStepActionExecution.addFileList(recorderService.recordExecutionInformationAfterStepActionandControl(testCaseStepActionExecution, null));1045 LOG.debug("Registering Action : " + testCaseStepActionExecution.getAction());1046 // We change the Action message only if the action is not executed due to condition.1047 MessageEvent actionMes = new MessageEvent(MessageEventEnum.CONDITION_TESTCASEACTION_NOTEXECUTED);1048 testCaseStepActionExecution.setActionResultMessage(actionMes);1049 testCaseStepActionExecution.setReturnMessage(testCaseStepActionExecution.getReturnMessage()1050 .replace("%COND%", testCaseStepActionExecution.getConditionOper())1051 .replace("%MESSAGE%", conditionAnswer.getResultMessage().getDescription())1052 );1053 testCaseStepActionExecution.setEnd(new Date().getTime());1054 this.testCaseStepActionExecutionService.updateTestCaseStepActionExecution(testCaseStepActionExecution);1055 LOG.debug("Registered Action");1056 }1057 } else {1058 // Error when performing the condition evaluation. We force no execution (false)1059 MessageGeneral mes = new MessageGeneral(MessageGeneralEnum.EXECUTION_FA_CONDITION);1060 mes.setDescription(mes.getDescription()1061 .replace("%COND%", testCaseStepActionExecution.getConditionOper())1062 .replace("%AREA%", "action ")1063 .replace("%MES%", conditionAnswer.getResultMessage().getDescription()));1064 testCaseStepActionExecution.setExecutionResultMessage(mes);1065 testCaseStepExecution.setExecutionResultMessage(testCaseStepActionExecution.getExecutionResultMessage());1066 testCaseStepActionExecution.setActionResultMessage(new MessageEvent(MessageEventEnum.CONDITION_TESTCASEACTION_FAILED)1067 .resolveDescription("AREA", "")1068 .resolveDescription("COND", testCaseStepActionExecution.getConditionOper())1069 .resolveDescription("MESSAGE", conditionAnswer.getResultMessage().getDescription()));1070 testCaseStepExecution.setStepResultMessage(new MessageEvent(MessageEventEnum.CONDITION_TESTCASESTEP_FAILED)1071 .resolveDescription("AREA", "action ")1072 .resolveDescription("COND", testCaseStepActionExecution.getConditionOper())1073 .resolveDescription("MESSAGE", conditionAnswer.getResultMessage().getDescription()));1074 if (testCaseStepActionExecution.getForceExeStatus().equals("PE")) {1075 testCaseStepActionExecution.setStopExecution(false);1076 MessageEvent actionMes = testCaseStepActionExecution.getActionResultMessage();1077 actionMes.setDescription(testCaseStepActionExecution.getActionResultMessage().getDescription() + " -- Execution forced to continue.");1078 testCaseStepActionExecution.setActionResultMessage(actionMes);1079 } else {1080 testCaseStepActionExecution.setStopExecution(true);1081 }1082 testCaseStepExecution.setStopExecution(testCaseStepActionExecution.isStopExecution());1083 testCaseStepActionExecution.setEnd(new Date().getTime());1084 this.testCaseStepActionExecutionService.updateTestCaseStepActionExecution(testCaseStepActionExecution);1085 LOG.debug("Action interupted due to condition error.");1086 // We stop any further Action execution.1087 if (testCaseStepActionExecution.isStopExecution()) {1088 break;1089 }1090 }1091 } else {1092 testCaseStepActionExecution.setEnd(new Date().getTime());1093 testCaseStepExecution.setExecutionResultMessage(testCaseStepActionExecution.getExecutionResultMessage());1094 testCaseStepExecution.setStepResultMessage(testCaseStepActionExecution.getActionResultMessage());1095 testCaseStepExecution.setStopExecution(testCaseStepActionExecution.isStopExecution());1096 this.testCaseStepActionExecutionService.updateTestCaseStepActionExecution(testCaseStepActionExecution);1097 LOG.debug("Registered Action");1098 if (testCaseStepActionExecution.isStopExecution()) {1099 break;1100 }1101 }1102 /**1103 * Log TestCaseStepActionExecution1104 */1105 if (tcExecution.getVerbose() > 0) {1106 LOG.info(testCaseStepActionExecution.toJson(false, true));1107 }1108 }1109 testCaseStepExecution.setEnd(new Date().getTime());1110 this.testCaseStepExecutionService.updateTestCaseStepExecution(testCaseStepExecution);1111 updateTCExecutionWebSocketOnly(tcExecution, false);1112 return testCaseStepExecution;1113 }1114 private TestCaseStepActionExecution executeAction(TestCaseStepActionExecution testCaseStepActionExecution, TestCaseExecution tcExecution) {1115 LOG.debug("Starting execute Action : " + testCaseStepActionExecution.getAction());1116 AnswerItem<String> answerDecode = new AnswerItem<>();1117 /**1118 * If execution is not manual, do action and record files1119 */1120 if (!tcExecution.getManualExecution().equals("Y")) {1121 testCaseStepActionExecution = this.actionService.doAction(testCaseStepActionExecution);1122 /**1123 * Record Screenshot, PageSource1124 */1125 try {1126 testCaseStepActionExecution.addFileList(recorderService.recordExecutionInformationAfterStepActionandControl(testCaseStepActionExecution, null));1127 } catch (Exception ex) {1128 LOG.warn("Unable to record Screenshot/PageSource : " + ex.toString(), ex);1129 }1130 } else {1131 /**1132 * If execution manual, set Action result message as notExecuted1133 */1134 testCaseStepActionExecution.setActionResultMessage(new MessageEvent(MessageEventEnum.ACTION_WAITINGFORMANUALEXECUTION));1135 testCaseStepActionExecution.setExecutionResultMessage(new MessageGeneral(MessageGeneralEnum.EXECUTION_WE));1136 testCaseStepActionExecution.setEnd(new Date().getTime());1137 }1138 /**1139 * Register Action in database1140 */1141 LOG.debug("Registering Action : " + testCaseStepActionExecution.getAction());1142 this.testCaseStepActionExecutionService.updateTestCaseStepActionExecution(testCaseStepActionExecution);1143 LOG.debug("Registered Action");1144 if (testCaseStepActionExecution.isStopExecution()) {1145 return testCaseStepActionExecution;1146 }1147 //As controls are associated with an action, the current state for the action is stored in order to restore it1148 //if some property is not defined for the country1149 MessageEvent actionMessage = testCaseStepActionExecution.getActionResultMessage();1150 MessageGeneral excutionResultMessage = testCaseStepActionExecution.getExecutionResultMessage();1151 /**1152 * Iterate Control1153 */1154 List<TestCaseStepActionControl> tcsacList = testCaseStepActionExecution.getTestCaseStepAction().getTestCaseStepActionControl();1155 for (TestCaseStepActionControl testCaseStepActionControl : tcsacList) {1156 /**1157 * Start Execution of TestCAseStepActionControl1158 */1159 long startControl = new Date().getTime();1160 /**1161 * Create and Register TestCaseStepActionControlExecution1162 */1163 LOG.debug("Creating TestCaseStepActionControlExecution");1164 TestCaseStepActionControlExecution testCaseStepActionControlExecution1165 = factoryTestCaseStepActionControlExecution.create(testCaseStepActionExecution.getId(), testCaseStepActionControl.getTest(), testCaseStepActionControl.getTestCase(),1166 testCaseStepActionControl.getStep(), testCaseStepActionExecution.getIndex(), testCaseStepActionControl.getSequence(), testCaseStepActionControl.getControlSequence(), testCaseStepActionControl.getSort(),1167 null, null,1168 testCaseStepActionControl.getConditionOper(), testCaseStepActionControl.getConditionVal1(), testCaseStepActionControl.getConditionVal2(), testCaseStepActionControl.getConditionVal3(), testCaseStepActionControl.getConditionVal1(), testCaseStepActionControl.getConditionVal2(), testCaseStepActionControl.getConditionVal3(),1169 testCaseStepActionControl.getControl(), testCaseStepActionControl.getValue1(), testCaseStepActionControl.getValue2(), testCaseStepActionControl.getValue3(), testCaseStepActionControl.getValue1(), testCaseStepActionControl.getValue2(),1170 testCaseStepActionControl.getValue3(), testCaseStepActionControl.getFatal(), startControl, 0, 0, 0,1171 testCaseStepActionControl.getDescription(), testCaseStepActionExecution, new MessageEvent(MessageEventEnum.CONTROL_PENDING));1172 this.testCaseStepActionControlExecutionService.insertTestCaseStepActionControlExecution(testCaseStepActionControlExecution);1173 LOG.debug("Executing control : " + testCaseStepActionControlExecution.getControlSequence() + " type : " + testCaseStepActionControlExecution.getControl());1174 /**1175 * We populate the TestCase Control List1176 */1177 testCaseStepActionExecution.addTestCaseStepActionExecutionList(testCaseStepActionControlExecution);1178 // Evaluate the condition at the control level.1179 AnswerItem<Boolean> conditionAnswer;1180 boolean conditionDecodeError = false;1181 if (!tcExecution.getManualExecution().equals("Y")) {1182 try {1183 answerDecode = variableService.decodeStringCompletly(testCaseStepActionControlExecution.getConditionVal1(), tcExecution, null, false);1184 testCaseStepActionControlExecution.setConditionVal1((String) answerDecode.getItem());...

Full Screen

Full Screen

getValue3

Using AI Code Generation

copy

Full Screen

1value1 = ${testCaseStepActionExecution.getValue1()}2value2 = ${testCaseStepActionExecution.getValue2()}3value3 = ${testCaseStepActionExecution.getValue3()}4value4 = ${testCaseStepActionExecution.getValue4()}5value5 = ${testCaseStepActionExecution.getValue5()}6value6 = ${testCaseStepActionExecution.getValue6()}7value1 = ${testCaseStepActionExecution.value1}8value2 = ${testCaseStepActionExecution.value2}9value3 = ${testCaseStepActionExecution.value3}10value4 = ${testCaseStepActionExecution.value4}11value5 = ${testCaseStepActionExecution.value5}12value6 = ${testCaseStepActionExecution.value6}

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.

Run Cerberus-source automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful