From dc60191b428945f004da7a3cc2c0b79dff20f0b3 Mon Sep 17 00:00:00 2001 From: hunter chen Date: Wed, 7 Aug 2019 21:21:43 +0800 Subject: [PATCH] add jsonpath --- httprunner/response.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/httprunner/response.py b/httprunner/response.py index 78e4776c..5cf20189 100644 --- a/httprunner/response.py +++ b/httprunner/response.py @@ -242,7 +242,9 @@ class ResponseObject(object): msg = "extract: {}".format(field) - if text_extractor_regexp_compile.match(field): + if field.startswith("$"): + value = self._extract_field_with_jsonpath(field) + elif text_extractor_regexp_compile.match(field): value = self._extract_field_with_regex(field) else: value = self._extract_field_with_delimiter(field)