Contributions
Re: Get request and response size in groovy
What if we want the size in Groovy not in script assertion Size of request and not response. Size of Response we can get through this statement testRunner.testCase.testSteps[Step].testRequest.response.responseSize How about size of request without using messageExhchange ?6 years agoPlace ReadyAPI QuestionsReadyAPI Questions2.1KViews0likes0Comments- 7 years agoPlace ReadyAPI QuestionsReadyAPI Questions6KViews0likes0Comments
Re: Want to mark test step as failed
I have the same problem as mentioned by you YOu want the teststep to appear fail but still want the test to continue. You cannot use assert as it stops the step there. Testrunner.fail stops testcase execution So what you can do is in each step take an arraylist ArrayList err=[] add all errors to it.. err.add (" error occured ") in the last print this arraylist err.each{log.info it} so if there are any error they will be printed. for marking the teststep as red that is failed assert err.size()==0 Regards Gaurav Khurana www.udzial.com7 years agoPlace ReadyAPI QuestionsReadyAPI Questions3.2KViews0likes1CommentRe: [Resolved] Possible to clear Log Output console using Groovy
though they should not make such changes try with capital L it works i mean change "Scipt log" to "Script Log" com.eviware.soapui.SoapUI.logMonitor.getLogArea("Script Log").clear()7 years agoPlace ReadyAPI QuestionsReadyAPI Questions5.4KViews0likes0CommentsRe: How to clear Log Ouput via groovy
Below codeactuallyclears the "log-output" ReadyaPI2.1 import com.eviware.soapui.SoapUI log.info("test") //Writing to the log is executed in the separate thread, so it is need to wait some time to get all notifications. sleep(1000) def teststep = context.getCurrentStep() def tesStepPanel = SoapUI.getDesktop().getDesktopPanel(teststep) if(tesStepPanel != null) { tesStepPanel.getComponent(2).getComponent(0).getComponent(1).getComponent(2).getComponent(0).clear() } Note that in ReadyAPI 2.2 you will need to use the following script: import com.smartbear.ready.core.ApplicationEnvironment log.info("test") //Writing to the log is executed in the separate thread, so it is need to wait some time to get all notifications. sleep(1000) def teststep = context.getCurrentStep() def tesStepPanel = ApplicationEnvironment.getDesktop().getDesktopPanel(teststep) if(tesStepPanel != null) { tesStepPanel.getComponent(3).getComponent(0).getComponent(1).getComponent(2).getComponent(0).clear() } Don'tforget to kudos/accept this as a solution7 years agoPlace ReadyAPI QuestionsReadyAPI Questions6.6KViews4likes3CommentsRe: [Resolved] Possible to clear Log Output console using Groovy
Below code actually clears the "log-output" Ready aPI2.1 import com.eviware.soapui.SoapUI log.info("test") //Writing to the log is executed in the separate thread, so it is need to wait some time to get all notifications. sleep(1000) def teststep = context.getCurrentStep() def tesStepPanel = SoapUI.getDesktop().getDesktopPanel(teststep) if(tesStepPanel != null) { tesStepPanel.getComponent(2).getComponent(0).getComponent(1).getComponent(2).getComponent(0).clear() } Note that in ReadyAPI 2.2 you will need to use the following script: import com.smartbear.ready.core.ApplicationEnvironment log.info("test") //Writing to the log is executed in the separate thread, so it is need to wait some time to get all notifications. sleep(1000) def teststep = context.getCurrentStep() def tesStepPanel = ApplicationEnvironment.getDesktop().getDesktopPanel(teststep) if(tesStepPanel != null) { tesStepPanel.getComponent(3).getComponent(0).getComponent(1).getComponent(2).getComponent(0).clear() } Don'tforget to kudos/accept this as a solution7 years agoPlace ReadyAPI QuestionsReadyAPI Questions5.9KViews0likes0CommentsRe: Enable & Disable test steps
Amy // This code dsiable all steps except the current step def tc=testRunner.testCase // get the current step Name String ts=testRunner.testCase.getTestStepAt(context.getCurrentStepIndex()).getLabel() // looping through all steps for(def tstp in tc.getTestStepList()) { String testStepName=tstp.getName() if(! (testStepName.contains(ts))) // Making sure all steps gets disabled but not this groovy as the code is written here. Otherwise further code will get stopped { log.info "*** Running test step *** " + testStepName tstp.setDisabled(true) //tstp.run(testRunner,context) } } // after the above step //you can define a variable tstp , get the the teststep reference and disable/enable.run it //Don't forget to press the kudos button if it worked for you5.2KViews1like0Comments