abdelkarim
12 days agoNew Contributor
Starting Mock Service from Groovy script
Hello there,
Whenever I try getting the mock runner when the project is just loaded I get a null pointer back. I have to navigate the project tree find each mock service and open it in the virtual service editor for it to be loaded correctly and only then does the script run successfully.
// small code extract
def server = project.getRestMockServiceByName(serverName)
def runner = server.getMockRunner()
assert runner != null
runner.start()
What difference does opening the Virtual Service Editor in the GUI make so the mock runner is accessible? And can I simulate this in my script, some tests rely on multiple mock services in different projects, having to manually find and start them would not be ideal?
Thanks