Skip to content
QiTASC.com / intaQt Tutorials / Getting Started with intaQt - Create the First Project /
Getting Started - Working with Context Objects
/ .. / .. /
Getting Started - Working...





Getting Started - Working With Context Objects

Now that we have created our First Test Case, including Scenario Outline and Custom Steps, we will continue on with Context Objects.

We need the "Hello World!" string that we created using Custom Steps more than once. We want to store it globally so that one change will modify it across the project. This is achieved by using Context Objects, which are defined in the configuration.

Working with Context Objects

Select the project.conf file that you already used for defining your Glue Path. Define a hello Context Object in the project.conf file as well, which will allow us to reference the Context Object simply by using the name:

Create Context Object

Change the step invocation in the FeatureWithCustomStep.feature file as the following:

With Context Object in Feature File

Run the test and it will print "Hello World!" in the console:

Print Hello

Conclusion

The "Getting Started" tutorial started off by walking you through intaQt Studio's main features, used to create a project and its associated files. We then introduced the main concepts used to construct test cases including Feature Files, Scenarios and Scenario Outlines, Stepdefs, Configuration Files, and Context Objects.

Now that you have finished this part of the tutorial, you are ready to start with intaQt. We recommend returning to the Tutorials section of the intaQt Resource Center, which includes other tutorials that are informative and will guide you through intaQt.