sburkardOccasional ContributorJoined 10 years ago10 Posts7 LikesLikes received1 SolutionView All Badges
ContributionsMost RecentMost LikesSolutionsRe: Environment handling Hi teak The "Service Endpoints" tab is not in the project view, but in the interface view (see Screenshot). It is very handy since you can there maintain all your endpoints and use the "Assign" button to switch "all requests and test requests" in one click to another endpoint. But with or without this tab, the centralized endpoint solution works exactly as Samy has written, with Project level properties. Regards Stephan Re: Environment handling We use the provided testrunner.sh shell script in the SoapUI/bin folder. You can give it for every run an individual endpoint with the -e switch that overrides ALL endpoints set in the individual teststeps of the project (but only for this run). There are plenty of other options like username etc., see here for all of them: http://www.soapui.org/test-automation/running-from-command-line/functional-tests.html We trigger the soapUI tests nightly with Jenkins, you can also switch on options to generate reports in JUnit format so that the results of the tests are directly shown in Jenkins. Another possibility would be the centralized endpoint example on this page (scroll down to centralized endpoint title) http://www.soapui.org/functional-testing/properties/working-with-properties.html Regards Stephan Re: retrieve endpoint passed in from test runner If you mean passed in from testrunner.sh shell script, then you can use the same solution as in this post http://community.smartbear.com/t5/SoapUI-Open-Source/Obtain-arguments-given-to-testrunner-sh-in-Script/m-p/107510 Re: Obtain arguments given to testrunner.sh in Script OK I finally found it. I can obtain the runner instance through the statically accessible SoapUI class. I already tried this, but I must have overseen the getCmdLineRunner method that does the trick. import com.eviware.soapui.SoapUI def runner = SoapUI.getCmdLineRunner() assert runner != null log.info runner.getEndpoint() log.info runner.getUsername() Re: Obtain arguments given to testrunner.sh in Script Hi nmrao Unfortunately not. It returns the currently set endpoint on the given Test-Request step (the one shown in the GUI when I open the step). When I call the project from CLI with another endpoint (using -e), I still get the same endpoint instead of the passed one. Stephan Re: Obtain arguments given to testrunner.sh in Script Hi Samy I'm not sure if we talk abound the same thing. I run a soapui project through commandline with the shell script testrunner.sh. This look somehow like this soapui/bin/testrunner.sh -eMyEndpoint -uUsername mySoapuiProjectfile.xml Now the project mySoapuiProjectfile.xml is executed and inside this project (in a Groovy TestStep of a testcase for example) I would like to find out what was passed as endpoint with the -e switch. Your code on the other side executes a project (what is in my case already done by calling the testrunner.sh on the command line. So I don't see how your code snippet is related to my question. Sorry, perhaps I am missing something completely Stephan Re: Obtain arguments given to testrunner.sh in Script Hi Samy Yeah, I noticed that, but the question is: how can I access the SoapUITestCaseRunner class from a Groovy Script teststep? Where do I get the instance that is created through testrunner.sh from? The given testrunner variable in the script is of type TestCaseRunner and it doesn't know the getEndpoint method. I also tried via static reference to SoapUI class, but didn't find a way through to SoapUITestCaseRunner. Or am I looking at the wrong place? Do I need to access it in another type of script (like load script or setup script)? Regards Stephan How to use shared testcases in another project for parallel execution? Hi I have several test-projects whose testcases need common "preparation" testcases. I would obviously like to create these preparation cases once and share them for all projects. Therefore I created a dedicated project and in this project I created a "TestHelper" testsuite containing such preparation test cases. From my normal test projects I am able to get the helper project and execute a testcase through a Groovy script. To reuse the caller script inside a project and to make the normal projects convenient to use, I created an additional testsuite inside the normal projects that is like an adapter to the shared helper-project. It contains testcases with just 1 teststep, the Groovy Script to call the real helper testcase in the helper project. From the normal testcase I can therefore use the standard and GUI supported "run TestCase" teststep to call the testcase in the adapter-testsuite (same project). This all works absolutely fine as long as I execute tests synchronously. To sum up: 1. [Normal TestCase in any testsuite in normal Project] contains run TestCase teststep => calls => 2. [Adapter-Testcase in adapter-testsuite in normal Project] that contains GroovyScript => calls => 3. [HelperTestcase in Helper project] The problem: As soon as I run them in parallel, the tests fail because they receive values from the helper project that are not correct. It looks like the calls to the helper project are not isolated per testcase. The big question is: How can I use a shared helper project while being able to run the tests in parallel? A more concrete question is: I configure the run TestCase steps in the normal testcases as "Crate isolated copy... (Thread-safe)". What does that really mean? I guess that soapUI creates a copy of the testcase I call. So in my case the adapter testcase containing the Groovy script. Therefore I guess the context variable in the script is safe to use because each call runs in an isolated copy. How can I then make the call to the helper project thread-safe? Thanks Stephan Re: Testrunner, Script and "isCommandLine" If you want to find out if soapui was called from the GUI or not, you can also check if the workspace is null: def workspace = testRunner.testCase.testSuite.project.getWorkspace() if(workspace != null) { // called by GUI } else { // called by command line } Obtain arguments given to testrunner.sh in Script Hi Is there a way to obtain the arguments given to testrunner.sh? For example the endpoint from the -e option or the username from the -u option? I found in the JavaDoc that the class AbstractSoapUITestRunner has methods to obtain all these values, but I didn't found a way to get them from a Groovy script inside the project that is executed. Thanks Stephan Solved