diff --git a/apitester/runtests/static/runtests/js/runtests.js b/apitester/runtests/static/runtests/js/runtests.js index 944ab50..c5de5bb 100644 --- a/apitester/runtests/static/runtests/js/runtests.js +++ b/apitester/runtests/static/runtests/js/runtests.js @@ -15,8 +15,7 @@ $(function() { path = $(runner).find('input[name="urlpath"]').val(); testpath = 'run/' + testmethod + "/" + path + "/" + testconfig_pk + "/"+ operationId ; $.post(testpath, { - 'num_runs':$(runner).find('input[name="numRun"]').val(), - 'json_body': runner.find('textarea').val(), + 'json_body': jsonBody, 'csrfmiddlewaretoken': window.CSRF }, function (data) { var alertType = 'success'; diff --git a/apitester/runtests/views.py b/apitester/runtests/views.py index 3678427..109ba60 100644 --- a/apitester/runtests/views.py +++ b/apitester/runtests/views.py @@ -261,8 +261,7 @@ def get_config(self, testmethod, testpath, testconfig_pk, operation_id): 'urlpath': urlpath if obj is None else obj.urlpath, 'operation_id': operation_id, 'profile_id': testconfig_pk, - 'payload': self.request.POST.get('json_body'), - 'num_runs': self.request.POST.get('num_runs') + 'payload': self.request.POST.get('json_body') } try: testconfig = TestConfiguration.objects.get( @@ -295,7 +294,10 @@ def run_test(self, config): if config['method'] == 'get' or config['method'] == 'delete': response = self.api.call(config['method'], url) else: - response = self.api.call(config['method'], url, json.loads(config['payload'])) + try: + response = self.api.call(config['method'], url, json.loads(config['payload'])) + except: + response = self.api.call(config['method'], url) try: text = response.json() except json.decoder.JSONDecodeError as err: