free seo tool

soapUI GroovyScript Test Step

If you are an automation expert, Groovy Script test step is for you. You can do basically anything you want in the same way you do that with other testing tools.

When we add "Groovy Script" test step to the testcase, it will provide an empty editor which you can write the script you want to.By default, it provides access to log, context and testRunner objects. You might make use of these objects or even you can import class/ packages from outside and make use of it.
We will be discussing more about groovy scripts and techniques in details in other posts. For the time being to get a feel of it, let us see a simple example.

Add the below line to the "Groovy Script" editor and click on the Run button.

log.info(context.testCase.name)

This will print the name of your test case in the log area. Here the command "context.testCase.name" will go from current context (script editor) to testCase level and the fetch the name of the test case. log.info will print the name to the log.
0 comments:
Post a Comment

This is a new website mainly for SOA Testers using soapUI. Let me know your thoughts/ suggestions.