Forum Discussion

Kate's avatar
Kate
Contributor
9 years ago

Empty Log and all tests pass (when should fail)

Hi all,

 

I'm creating my first project with TestComplete. Need help.

 

I created simple script in Python to run my tested app.

When I run the routine, it does not do anything with my app, but says the test passed. The log is created, but stays empty.

'Open app from scripts' is checked.

 

Here is my script:

 

def open_myapp():
     Log.Message('Hello')  #just to have smth in my log... but nothing gets there
     TestedApps.myapp.Run()
     time.sleep(3)
     if not Sys.WaitProcess('myapp').Exists:
          Log.Error('MYAPP did not start!')

 

Any help will be kindly appreciated. 

  • Bobik's avatar
    Bobik
    Frequent Contributor

    How do you run script? Do you run function directly or run whole project?

    Are there any messageboxes displayed?

    Also check that all message types are enabled to show in log. see picture.

     

    Looks like playback doesn't start at all.

    • Kate's avatar
      Kate
      Contributor

      I tried to run the script both ways.

      Are Messageboxes == lines in Log table? If yes, so my answer is no - there is no messageboxes (no lines in my log table)

      All message types are enabled.

       

      I fell like the playback does not start at all as well... What should I do to make it start?

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        OK... first of all, I verified that, yes, the routine will run... IF you remove the "timer.sleep" call.  That's not recognized by the Python parser for TestComplete.  If you want a 3 second sleep, replace that line with aqUtils.Delay(3000)

         

        In the meantime, there are MULTIPLE ways to get a test to run... this is what Bobik was getting at.

         

        1) Is it added as a TestItem on the project?

        2) Is it being called from some other routine?

        3) Are you right-clicking and selecting "Run current routine"?

        These are the three main ways to get your function to run...  which one are you doing?