Contributions
Re: How to access 'context' object from mockRunListener events
Ole, Thank you so much. It does work now. Somehow, I just did not catch the typo and script language is not strong at type/syntax chechking. thanks again. sheena14 years agoPlace ReadyAPI QuestionsReadyAPI Questions1.6KViews0likes0CommentsRe: How to access 'context' object from mockRunListener events
Hi, Dain, I copied the my script here, not sure what is wrong but I could not get the mock request logged into my file. I could not even find file in the expected directory. thanks sheena ===MockRunListener.moMockRunnerStart=========== def logfile = "D:/XML-Testing/WebNBI/SoapUIPro/TestResultR7.3/MyMockLogFile.log"; log.info(logfile); def File myMockFile = new File(logfile); myMockFile.append("this is a test"); log.info(myMockFile); if ( myMockFile.exists()) { myMockFile.delete() myMockFile = new File(logfile); } runner.mockContext.setProperty("MyMockLogFile", myMockFile); ===MockRunListener.onMockResult if ( result ) { def mockReq = result.getMockRequest() def context = result.mockRequest.context; if ( context.MyMockLogFile) { def filehandle = context.myMockLogFile; filehandle.append ( mockReq.getRequestContent()) log.info("Has Mock Log file"); } log.info(mockReq.getRequestContent()); }14 years agoPlace ReadyAPI QuestionsReadyAPI Questions1.6KViews0likes0CommentsRe: How to access 'context' object from mockRunListener events
Dain, thanks for your response but I am not sure I have complete solution as you suggested. How do I get this property from onMockResult() Do I have access to runner object ? In onMockResult, I have result object but not sure how to get runner object sheena14 years agoPlace ReadyAPI QuestionsReadyAPI Questions1.6KViews0likes0CommentsHow to access 'context' object from mockRunListener events
I try to access context object inside the mock events : such as onMockRunnerStart, onMockResult but got error. What is the proper way to access context object inside mock events callback script ? thanks sheena For example for onMockRunnerStart event, I want to perform: ..... context.setProperty("myLogFile", filehandler) for onMockResult event, I want to perform: context.myLogFile thanks sheena14 years agoPlace ReadyAPI QuestionsReadyAPI Questions3.3KViews0likes8Comments- 14 years agoPlace ReadyAPI QuestionsReadyAPI Questions890Views0likes0Comments
Re: Which event handler to get Soap Respnse content?
I tried to use TestRunListener.afterStep to get Soap response. seems work but I need only trigger this script when testStep is 'request'. I don't know how to filter other type testStep as I have trouble to access testStep object inside the callback from this event. Still need help. thanks sheena ==== problem script for sfterStep event==== import com.eviware.soapui.support.xml.XmlUtils //log.info(testStep.config.type) can't access testStep here. if( testStepResult.response == null ) return def rsp_str = testStepResult.response.responseContent14 years agoPlace ReadyAPI QuestionsReadyAPI Questions890Views0likes0Comments