Forum Discussion

patelakhil's avatar
patelakhil
Contributor
16 years ago

How to create global object which can be accessible from testsuite, testcase etc

Hi,

I want to create instance of one object on startup of the run and same object i can be able to access from testsuite level, testcase level and groovy test step level.

So how can i do it?

Thanks,
Akhilkumar Patel - Test Automation Architecture
  • Hi!

    if you put a property in the context available in the Setup Script at the project level, this will be copied to all contexts in subsequent testsuite and testcase executions.. ie

    context.myValue = "hello"

    in the Project Setup Script

    will then allow for

    log.info context.myValue in all contained testsuites and testcases provided that they are executed within a project-level run.

    Does that help?

    regards!

    /Ole
    eviware.com

  • I have tried your solution with String type object and it is working. So let us try same with some other type of object.

    Thanks,
    Akhilkumar Patel - Test Autoamtion Architecture