Forum Discussion

km's avatar
km
Occasional Contributor
13 years ago

Wait until the process loads - performance testing & timing

Hello,



I'm trying to figure out how to set up the scripts wait until the process loads.  This is performance testing on a distributed system, and I need to time the each execution, such as save or import.  Is there any way to wait unless I don't specify the time?



Thanks!!
  • Hi,



    To wait for a process, you need to use the Sys.WaitProcess method. You need to specify a timeout in it, but it will return as soon as the target process loads, so, it is OK to use a large timeout, and this won't create a greater delay.
  • km's avatar
    km
    Occasional Contributor
    Unfortunately, Sys.WaitProcess doesn't return as soon as the target process loads when the timeout is set up. 



    Thanks!
  • Hi,



    How do you call WaitProcess? Also, how long does it take your process to load and how long does WaitProcess actually wait? Does it return a valid reference (Exists equals true) to your process?
  • km's avatar
    km
    Occasional Contributor
    I called like:

    Sys.WaitProcess("...application  name");



    Usually, it comes back before the process loads.
  • km's avatar
    km
    Occasional Contributor
    When I called with the timeout which should be more than the loading time, it waits exactly for the timeout.
  • km's avatar
    km
    Occasional Contributor
    When I tried on the return value with Validate(object), the return value doesn't validate.
  • Hi,



    You should check the returned object's Exists property. If it equals false, make sure that you address the correct process (check the name you pass to WaitProcess).
  • km's avatar
    km
    Occasional Contributor
    Exists retruns true, but it doesn't wait the process.
  • Hi,



    OK, we still need to have a detailed description of the behavior you observe.

    1. What is the exact code for the WaitProcess call.

    2. Exactly, how long (in milliseconds) does it take your application to load.

    3. Exactly, how long (in milliseconds) does it take WaitProcess to return.

    4. What is its result?

    5. Is the result correct (corresponds to the appropriate process)?

    6. What is the exact process name as displayed in the Object Browser?