cancel
Showing results for 
Search instead for 
Did you mean: 

ReadyAPI Groovy script debugger - How to inspect ReadyAPI variables?

SOLVED
Highlighted
Contributor

ReadyAPI Groovy script debugger - How to inspect ReadyAPI variables?

A groovy script in ReadyAPI references ReadyAPI variables like "context". For example, like this - String scriptVar = context.expand( '${#TestCase#myVariable}' ). I would like to inspect the variables inside "context" before they are "expanded" by the script and assigned to variables like scriptVar. How do I do that while debugging ?

In the debugger variables, I expanded the "context" variable to show all its internal variables. But, I could not find any obvious place where all its variables like myVariable would be stored.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Manager

Re: ReadyAPI Groovy script debugger - How to inspect ReadyAPI variables?

Hi @rajs2020,

I think logging a variable value can be one of the options:

log.info(scriptVar)
or
log.info (context.expand( '${#TestCase#myVariable}' ))

 

Please take a look at all possible options in the Debugging Groovy scripts paragraph.

---------
Tanya Gorbunova
SmartBear Community Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️

View solution in original post

1 REPLY 1
Highlighted
Community Manager

Re: ReadyAPI Groovy script debugger - How to inspect ReadyAPI variables?

Hi @rajs2020,

I think logging a variable value can be one of the options:

log.info(scriptVar)
or
log.info (context.expand( '${#TestCase#myVariable}' ))

 

Please take a look at all possible options in the Debugging Groovy scripts paragraph.

---------
Tanya Gorbunova
SmartBear Community Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️

View solution in original post

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors