Contributions
Re: ProgressDialog
Hi all, After a lot of time spent to find a solution I've tested successfully the following code in Eclipse: package soapui.testStep; import com.eviware.soapui.support.components.ProgressDialog; public class progressBar { public static void main(String[] args) { final Integer delayBeforeReply = 5000; String msg = "Waiting " + delayBeforeReply + " ms before processing the reply part."; final ProgressDialog progressBar = new ProgressDialog("Wait", msg, delayBeforeReply, "0", false); Runnable r = new Runnable() { public void run() { for (int i=1;i<=delayBeforeReply/1000;i++) { progressBar.setProgress(i, (delayBeforeReply/1000)-(i-1) + " second(s) remaining ..."); try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } } progressBar.dispose(); } }; new Thread(r).start(); progressBar.setVisible(true); } } But when I adapt it to SoapUI with the groovy version, the progress bar never disappear .. Can someone help me ? Thanks in advance, Arnaud.812Views0likes0CommentsProgressDialog
Hi, I tried quite everything in the SoapUI API for progress bars and dialogs .. without results. I've also tried several samples found on google during three hours, but no examples are related to SoapUI. When I execute this simple groovy script the progress dialog never progress and doesn't disappear (even if I put the parameter allowCancel of the constructor ProgressDialog to true like in the example). delayBeforeReply = 3000; msg = "Waiting " + delayBeforeReply + " ms before processing the reply part."; progressBar = new com.eviware.soapui.support.components.ProgressDialog("Wait", msg, delayBeforeReply, "0", true); progressBar.setVisible(true); for (int i=0;i<=delayBeforeReply;i++) { Thread.sleep(1); progressBar.setProgress(i, ""+i); } progressBar.setVisible(false); progressBar.dispose(); Do you have any solution ? What's wrong with my code ? Kind regards, Arnaud.1.7KViews0likes2CommentsRe: ClassCastException - getProperty() used with array
Hi, I've found the problem .. It was a very strange problem ... I've simply inversed the two following lines: List sides = (List) runContext.getProperty("sides"); String senderSideStatus, receiverSideStatus; I suppose it's a bug in SoapUI or Java because it's not very logic I think Bye, Arnaud.2.1KViews1like0CommentsRe: ClassCastException - getProperty() used with array
Hi, Here my class: package soapui.testStep; import java.util.List; import com.eviware.soapui.model.testsuite.TestRunContext; import com.eviware.soapui.model.testsuite.TestRunListener; import com.eviware.soapui.model.testsuite.TestRunner; import com.eviware.soapui.model.testsuite.TestStepResult; import com.eviware.soapui.model.testsuite.TestStepResult.TestStepStatus; public class TestStepListener implements TestRunListener { public void beforeRun(TestRunner testRunner, TestRunContext runContext) { } public void afterRun(TestRunner testRunner, TestRunContext runContext) { } public void beforeStep(TestRunner testRunner, TestRunContext runContext) { } public void afterStep(TestRunner testRunner, TestRunContext runContext, TestStepResult result) { if (result.getStatus()==TestStepStatus.FAILED) { // List sides = (List) runContext.getProperty("sides"); String senderSideStatus, receiverSideStatus; // senderSideStatus = (String) runContext.getProperty("expected" + (String) sides.get(0) + "ModelStatus"); // receiverSideStatus = (String) runContext.getProperty("expected" + (String) sides.get(1) + "ModelStatus"); senderSideStatus = (String) runContext.getProperty("expected" + (String) runContext.getProperty("side0") + "ModelStatus"); receiverSideStatus = (String) runContext.getProperty("expected" + (String) runContext.getProperty("side1") + "ModelStatus"); if (runContext.getCurrentStep().getName().equals("receiveRequest") && (senderSideStatus.equals("Failed") || (senderSideStatus.equals("Started") && receiverSideStatus.equals("Failed")))) { // Test must fail so it is OK } else { runContext.setProperty("testFailed", true); runContext.setProperty("testStepName", runContext.getCurrentStep().getName()); runContext.setProperty("testStepErrors", testRunner.getResults().get(runContext.getCurrentStepIndex()).getMessages()); } testRunner.gotoStepByName("Loop to next properties file"); } } } I hope this will help you to help me2.1KViews0likes0CommentsRe: ClassCastException - getProperty() used with array
Now I use List<String> sides = (List<String>) runContext.getProperty("sides"); String side1 = (String) sides.get(0); String side2 = (String) sides.get(1); But SoapUi doesn't launch. It shows the following error in the command prompt: Exception in thread "main" java.lang.ClassFormatError: Field "side1" in class soapui/testStep/TestStepListener has illegal signature "append" ... I really don't understand the problem. This code causes no error in Eclipse .. Arnaud2.1KViews0likes0CommentsClassCastException - getProperty() used with array
Hello, In a groovy script step I have this code: def sides = ["value1", "value2"]; context.setProperty("sides", sides); And in a listener (java code complied to a jar) I want to access each element of my array. But I don't know the correct syntax. I tried this without success: String[] sides = (String[]) runContext.getProperty("sides"); This code causes the following error in the testcase log: TestCase failed [java.lang.ClassCastException: java.util.ArrayList:java.lang.ClassCastException: java.util.ArraytList], time taken = 28387 The solution is probably easy but I'm not familiar with SoapUI casting and I've not found any specific method for array properties in the API. Thanks in advance, ArnaudSolved3.8KViews0likes8CommentsHTML entities transformed between two steps
Hi, I have two steps: - Step 1: a simple HTTP request step with a return response in XML format like this: <tag attr="valueAttrb">value</tag> - Step 2: a SOAP Request step with this as request value: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Header> some header </soapenv:Header> <soapenv:Body> ${Step 1#Response} </soapenv:Body> </soapenv:Envelope> The problem is that with this property transfert, quotes (the character ") are transformed into " So the result will be: <tag attr="valueAttrb">value</tag> But I cannot accept this transformation of the content. Is there a way to get the initial response ? Kind regards, Arnaud.1.6KViews0likes2Comments- 1KViews0likes0Comments