Forum Discussion

Alcatel-Lucent__10's avatar
Alcatel-Lucent__10
Occasional Contributor
13 years ago

starting a testcase from mock onrequest script

I have a mockservice running. When I receive a request of type A, I want to start a specific testcase.

How can I achieve this ? It was my intention to use the onRequest script to start the testcase.

I have following code, but this is not working :

mockRunner.mockService.project.getTestSuitByName("test").getTestCaseByName("testcase1").run()

Thanks in advance,
Philip

2 Replies

  • Hi,

    I'm sorry for the slow response. Yes, this is definitely possible! If you modify your code a little bit to look like this
    import com.eviware.soapui.support.types.StringToObjectMap
    mockRunner.mockService.project.getTestSuiteByName("test").getTestCaseByName("testcase1").run(new StringToObjectMap(), false)

    it should do what you want.

    --
    Regards,

    Arian
    SmartBear Sweden