TestProject Forum

Test Failed when running by Generated Code Python

Hi, My test works well on Testproject, but it was failed when running by generated code that is downloaded, I use Python language and Intellij IDEA to compile, whether i missed something? please help.

# 10. Get the latest SMS message text
    step_output = driver.addons().execute(
        GetLatestSmsText.getsms(
        ))
    assert "RS" in step_output.smsOutput

    otpResult = step_output
  # 11. Extract Sub-String from '{otpResult}' using '[0-9]{4}$'
    step_output = driver.addons().execute(
        StringUtils.extractstringusingregex(
            regex="[0-9]+$",
            input=f'{otpResult}'))
    otpInput = step_output

Error log:

src.testproject.sdk.exceptions.sdkexception.SdkException: Error occurred during addon action execution: Could not find anything using Regex '[0-9]+$'

/usr/local/lib/python3.9/site-packages/src/testproject/helpers/addonhelper.py:65: SdkException