Contributions
groovy not working
I tried running the following groovy script without success java.lang.Runtime r = java.lang.Runtime.getRuntime(); java.lang.Process p = r.exec("ruby C:\\ruby\\rubyFile.rb"); Thread.sleep(60000); the ruby file is a watir script that goes to a web page and does a few things. when I click run in soapui, it stalls for a few seconds but nothing happens. I tried running the same rubyFile in cmd line and it works fine. What could be the problem here? Thanks in advance1.7KViews0likes2Comments- 1.9KViews0likes0Comments
write junit test in groovy script...
Hi there, I have the following piece of code which is a junit test class to test a web page: import junit.framework.*; import com.thoughtworks.selenium.*; import junit.textui.TestRunner; public class Temp extends TestCase { private Selenium browser; public Temp(String name) { super(name); } public void setUp() { //some code } public static TestSuite suite() { return new TestSuite(Temp.class); } public void test1(){ // some code } public void tearDown() { // some code } public static void main(String[] args){ Temp test = new Temp("test"); TestRunner a = new TestRunner(); TestResult result = a.run(test.suite()); } } This works fine in eclipse but in groovy i get the error : groovy.lang.GroovyRuntimeException: Failed to create Script instance for class: class Temp. Reason: java.lang.InstantiationException: Temp why can't i instantiate the Temp class in groovy? Any idea on how to work around this? thanks,3.8KViews0likes4Commentsparameter passing
Hi all, so I have a datasource test step in which I retrieve an URL from the database. In the next step I have a groovy script like so: def URL = context.expand( '${DataSource#URL}' ) java.lang.Runtime a = java.lang.Runtime.getRuntime(); java.lang.Process b = a.exec("ruby C:\\ruby\\test.rb "); Thread.sleep(30000); As you can see I am getting the URL from the previous step and call the ruby script test.rb. However, what I really want to do is pass URL to the ruby script as a parameter but I don't know how to. Can any body share the sample codes to: 1- pass a parameter in groovy when calling a ruby script 2- get the parameter in ruby thanks in advance1.4KViews0likes0CommentsRe: junit test case in soapUI?
Here is my piece of code that I have in a groovy test step: import junit.swingui.TestRunner; public class Temp { public static void main(String[] args){ TestRunner a = new TestRunner(); a.run(GoogleTest.class); } } GoogleTest.class contains the set of test cases that I am trying to run in soapUI. I tried this in Eclipse and it works fine, but in soapUI I get the following error: org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.NoSuchMethodError: junit.runner.BaseTestRunner.inVAJava()Z Don't know how to fix this. any ideas? thanks2KViews0likes0Commentsjunit test case in soapUI?
I have this java class which contains a set of junit test cases, each one of them test a web page. I was wondering if it possible to call that class in a groovy test step in soapui, in the same way a ruby program is called. here is how a ruby program is called in a groovy step in soapui, is there anything similar to this for java programs java.lang.Runtime a = java.lang.Runtime.getRuntime(); java.lang.Process b = a.exec("ruby C:\\ruby\\my_file.rb"); Thread.sleep(30000); thx4.2KViews0likes9Comments