public void StopRecording() { StopRecordingParamsBuilder _stopRecordingBuilder = new StopRecordingParamsBuilder(); if (_userPathExist) { UpdateUserPathParamsBuilder _updateUserPathBuilder = new UpdateUserPathParamsBuilder(); _updateUserPathBuilder.name(_userPathName); _updateUserPathBuilder.deleteRecording(true); _stopRecordingBuilder.updateParams(_updateUserPathBuilder.Build()); } try { _client.StopRecording(_stopRecordingBuilder.Build()); _client.SaveProject(); if (_systemProxyHelper != null) { _systemProxyHelper.restoreProxy(); } } finally { _recordStarted = false; _instance = null; _systemProxyHelper = null; } }
public ActionResult StopRecordingActionHandler(ProcessStepData stepData) { _log.Info("Starting execution of StopRecordingActionHandler"); if (neoLoadDesignApiInstance == null || !neoLoadDesignApiInstance.IsRecordStarted()) { _log.Info("Recording not started, nothing to stop."); return(new ActionResult(false, "No recording started", "")); } string advanced = stepData.GetActionArg(Parameters.ADVANCED, ""); AdvancedParameters advancedParameters = new AdvancedParameters(advanced); bool frameworkParameterSearch = advancedParameters.GetBooleanValue(Parameters.FRAMEWORK_PARAMETER_SEARCH, "true"); bool genericParameterSearch = advancedParameters.GetBooleanValue(Parameters.GENERIC_PARAMETER_SEARCH, "false"); StopRecordingParamsBuilder stopRecordingParamsBuilder = new StopRecordingParamsBuilder(); stopRecordingParamsBuilder.frameworkParameterSearch(frameworkParameterSearch).genericParameterSearch(genericParameterSearch); bool deleteRecording = advancedParameters.GetBooleanValue(Parameters.DELETE_RECORDING, "true"); bool includeVariables = advancedParameters.GetBooleanValue(Parameters.INCLUDE_VARIABLES_IN_USER_PATH_UPDATE, "true"); bool updateSharedContainers = advancedParameters.GetBooleanValue(Parameters.UPDATE_SHARED_CONTANERS, "false"); string matchingThreshold = advancedParameters.GetValue(Parameters.MATCHING_THRESHOLD, ""); UpdateUserPathParamsBuilder updateUserPathParamsBuilder = new UpdateUserPathParamsBuilder(); updateUserPathParamsBuilder.deleteRecording(deleteRecording).includeVariables(includeVariables).updateSharedContainers(updateSharedContainers); if (!matchingThreshold.Equals("")) { updateUserPathParamsBuilder.matchingThreshold(int.Parse(matchingThreshold)); } string message; bool status; try { _log.Info("Sending API call StopRecording"); neoLoadDesignApiInstance.StopRecording(stopRecordingParamsBuilder, updateUserPathParamsBuilder); message = "record stopped"; if (systemProxyHelper != null) { _log.Info("Restoring system proxy"); systemProxyHelper.restoreProxy(); systemProxyHelper = null; } status = true; } catch (Exception e) { _log.Error("Unable to send API call StopRecording", e); status = false; message = e.Message; } return(new ActionResult(status, message, "")); }
public void StopRecording(StopRecordingParamsBuilder stopRecordingBuilder, UpdateUserPathParamsBuilder updateUserPathBuilder) { if (_userPathExist) { updateUserPathBuilder.name(_userPathName); stopRecordingBuilder.updateParams(updateUserPathBuilder.Build()); } try { _client.StopRecording(stopRecordingBuilder.Build()); } finally { _recordStarted = false; } }