Невозможно выполнить файл Python из Katalon - PullRequest
0 голосов
/ 15 мая 2019

Я хочу выполнить скрипт Python из студии Katalon.

Ниже приведен код, который я пытаюсь выполнить из Katalon.

def scriptPath = "/Users/amiteshshukla/Documents/Work/highRoads/docgen_validation/docgen_validation.py"
def command = "python $scriptPath"
def result = command.execute().text
println result
return result

, и это скрипт Python, который яхочу выполнить.

#!/usr/bin/env python3

class DocgenValidator:

    print("THis is one of the check***************")

    def __init__(self, baseline_doc_path: str, updated_doc_path: str):

        # Validating inputs
        if not isinstance(baseline_doc_path, str) or baseline_doc_path is None:
            raise TypeError(f" Expected {baseline_doc_path} to be of type str, got {type(baseline_doc_path).__name__}")

        if not isinstance(updated_doc_path, str) or updated_doc_path is None:
            raise TypeError(f" Expected {updated_doc_path} to be of type str, got {type(updated_doc_path).__name__}")

        self.baseline_doc_path = baseline_doc_path
        self.updated_doc_path = updated_doc_path

        self.WORD_NAMESPACE = '{http://schemas.openxmlformats.org/wordprocessingml/2006/main}'
        self.PARA = self.WORD_NAMESPACE + 'p'
        self.TEXT = self.WORD_NAMESPACE + 't'
        print("THis is one of the check***************")


Но на выходе я вижу это:

SLF4J: The requested version 1.7.16 by your slf4j binding is not compatible with [1.6]
SLF4J: See http://www.slf4j.org/codes.html#version_mismatch for further details.

2019-05-15 13:48:09.562 INFO  c.k.katalon.core.main.TestCaseExecutor   - --------------------
2019-05-15 13:48:09.567 INFO  c.k.katalon.core.main.TestCaseExecutor   - START Test Cases/PythonRead
2019-05-15 13:48:10.400 DEBUG testcase.PythonRead                      - 1: scriptPath = "/Users/amiteshshukla/Documents/Work/highRoads/docgen_validation/docgen_validation.py"
2019-05-15 13:48:10.402 DEBUG testcase.PythonRead                      - 2: command = python $scriptPath
2019-05-15 13:48:10.417 DEBUG testcase.PythonRead                      - 3: result = text
2019-05-15 13:48:10.537 DEBUG testcase.PythonRead                      - 4: println(result)

2019-05-15 13:48:10.541 DEBUG testcase.PythonRead                      - 5: return result
2019-05-15 13:48:10.544 INFO  c.k.katalon.core.main.TestCaseExecutor   - END Test Cases/PythonRead

1 Ответ

0 голосов
/ 15 мая 2019

Режим сценария Katalon принимает код Groovy / Java.

Python не поддерживается. есть некоторые разговоры об этом, но текущая версия (6.1.5) пока не поддерживает это.Здесь есть обходной путь , если это поможет.

...