We are building a new experience for our SmartBear Community.
This site is now read-only. You can still browse and search as usual. Learn More

Forum Discussion

pse's avatar
pse
Occasional Contributor
1 year ago
Solved

"SystemError: NULL Object passed to Py_BuildValue" Delay() in Python

Am I writing my functions incorrectly? What is causing this? This is causing my tests to fail inconsistently. Thanks

  • Refer to Using WaitNNN Methods in https://support.smartbear.com/testcomplete/docs/app-objects/common-tasks/waiting-process-or-window-activation.html . There are existing methods which you can use, to wait for an object to exist and timeout after a number of seconds.

    Delay and aqUtils.Delay methods work fine.

    Without seeing your actual code, it's difficult to provide help

     

8 Replies

  • Hassan_Ballan's avatar
    Hassan_Ballan
    Icon for Champion Level 3 rankChampion Level 3

    As per https://support.smartbear.com/testcomplete/docs/keyword-testing/reference/misc/delay.html Scripting Analogue section hints to https://support.smartbear.com/testcomplete/docs/reference/program-objects/aqutils/delay.html method.

    It should work as you have it; however, try using aqUtils.Delay(ms, Str) 

    • Hassan_Ballan's avatar
      Hassan_Ballan
      Icon for Champion Level 3 rankChampion Level 3

      I have created a new project to try it out and in a long loop, and it worked properly.

      I tried the following variations:
      1. Delay(100, "Message")
      2. aqUtils.Delay(100, "Message")
      3. import time
          time.sleep(100)

      Perhaps it is failing due to your project sequence of events or state, and that would be hard to fix. I suggest you try the same and use what ever works for you starting with a reboot.

      • pse's avatar
        pse
        Occasional Contributor

        Same thing is intermittently happening with aqUtils

  • pse's avatar
    pse
    Occasional Contributor

    Thanks for the recommendations, will update with aqUtils and see if the issue comes up

  • rraghvani's avatar
    rraghvani
    Icon for Champion Level 3 rankChampion Level 3

    What exactly are you doing, and what's the coding?

    • pse's avatar
      pse
      Occasional Contributor

      I am trying to delay in the "except" of a try-except function. If an object is not found, wait 3 seconds and look for the object again.

  • rraghvani's avatar
    rraghvani
    Icon for Champion Level 3 rankChampion Level 3

    Refer to Using WaitNNN Methods in https://support.smartbear.com/testcomplete/docs/app-objects/common-tasks/waiting-process-or-window-activation.html . There are existing methods which you can use, to wait for an object to exist and timeout after a number of seconds.

    Delay and aqUtils.Delay methods work fine.

    Without seeing your actual code, it's difficult to provide help