gauravkhuranaOccasional ContributorJoined 8 years ago21 Posts6 LikesLikes received1 SolutionView All Badges
ContributionsMost RecentMost LikesSolutionsRe: GroovyScript - Compare Two XML's Ignoring TextAndAttribute Best code i was able to find on internet to compare 2 XMLs. Best thing is it will tell you where the difference is there in the 2 XMLs Re: GroovyScript - Compare Two XML's Ignoring TextAndAttribute Thanks a ton.. Thats the best way available on internet to compare 2 XMLs. 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 ? Re: How to clear Log Ouput via groovy i have tested it works fine even in Ready API 2.3.0 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.com Re: [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() Re: How to clear Log Ouput via groovy Below code actually clears the "log-output" Ready aPI 2.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't forget to kudos/accept this as a solution Re: [Resolved] Possible to clear Log Output console using Groovy Below code actually clears the "log-output" Ready aPI 2.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't forget to kudos/accept this as a solution Re: 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 you Re: Run Particular Test Steps on different suite in the Same Project if the code worked for you, Support the answers by Giving "kudos" to the aswer