Article - Testing for memory usage or getting a process ID with applicationContext

Skip to end of metadata
Go to start of metadata

Every application is started in an application context. Application contexts are accessible in test scripts and they offer a number of functions and properties, including usedMemory:

def main():
    startApplication("addressbook")
    # ...

    ctx = currentApplicationContext()
    test.log(ctx.usedMemory)
    test.log(ctx.pid)

This will print the memory used by the current application and its process ID to the test log.

The application context functions and properties are documented in the Squish API section under Application Context.

Also see:

Labels:
memory memory Delete
applicationcontext applicationcontext Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.