TestProject Forum

ERROR: No development token

I am facing the below error while running testcases with TestProject SDK 1.2.1 I have generated code from testproject platform and the token is mentioned in the webdriver .

/usr/local/lib/python3.6/dist-packages/src/testproject/sdk/drivers/webdriver/chrome.py:64: in init
report_path=report_path,
/usr/local/lib/python3.6/dist-packages/src/testproject/sdk/drivers/webdriver/base/basedriver.py:80: in init
env_token = ConfigHelper.get_developer_token()


@staticmethod
def get_developer_token() -> str:
    """Returns the TestProject developer token as defined in the TP_DEV_TOKEN environment variable

    Returns:
        str: the developer token
    """
    token = os.getenv("TP_DEV_TOKEN")
    if token is None:
        logging.error("No developer token was found, did you set it in the TP_DEV_TOKEN environment variable?")
        logging.error(
            "You can get a developer token from https://app.testproject.io/#/integrations/sdk?lang=Python"
        )
      raise SdkException("No development token defined in TP_DEV_TOKEN environment variable")

E src.testproject.sdk.exceptions.sdkexception.SdkException: No development token defined in TP_DEV_TOKEN environment variable

/usr/local/lib/python3.6/dist-packages/src/testproject/helpers/confighelper.py:61: SdkException
------------------------------------------------------ Captured log setup -------------------------------------------------------
ERROR root:confighelper.py:57 No developer token was found, did you set it in the TP_DEV_TOKEN environment variable?
ERROR root:confighelper.py:59 You can get a developer token from TestProject
==================================================== short test summary info ====================================================
ERROR Portal_Store/test_store.py::test_main - src.testproject.sdk.exceptions.sdkexception.SdkException: No development token d…
======================================================= 1 error

This is a bug: False error is logged about a missing token when it's set via driver constructor · Issue #181 · testproject-io/python-opensdk · GitHub
Please use SDK version 1.2.0 or set the token via the TP_DEV_TOKEN variable.

1 Like