While using groovy script or doing automation testing of web services using soapUI, we might need to display values, errors or other information. Groovy provides the feature of displaying an alert box for the same purpose. Let us take a look into it.
com.eviware.soapui.support.UISupport Class provide 3 methods to display an alert box.
- showInfoMessage(java.lang.String)
- showInfoMessage(java.lang.String, java.lang.String)
- showErrorMessage(java.lang.String)
Example use of Groovy Alert boxes.
def alert = com.eviware.soapui.support.UISupport;
//This will display an information message
alert.showInfoMessage("Hello World !");//This will display an information message, but the dialog box title will be "soapUI Warning"
alert.showInfoMessage("Hello World !","soapUI Warning !")//This will display an Error message
alert.showErrorMessage("Hello World !")Information Dialog
Information Dialog with Title
Error Dialog
Thank You for your post
this is not working !!!
:(
Kindly suggest.
Did you try this on "Groovy Script" test step or inside a script assertion?
I had tried this in an ERP console which is totally a groovy based Application.
This groovy code is strictly for the tool soapUI. It is using objects from soapUI to display the alert. So it won't work on out side the tool
Thanks for this. I wish I'd known about this class before!
Nice Post..Simple and useful
Almost a year later I stumbled on this exactly at the time I needed it. Tank you. And thank you google for leading me here.
Hi all
extension to this question, how to display alert for certain time. timer based alert.
Hi there,
Nice description.
Could you please help us how we can avoid these dialogue/pop-ups? Sometime even with mentioning 'return' at the end of GroovyScript is not stopping them.
Works great!
How do you use a variable inside the message eg alert.showInfoMessage("myvarhere");
Can any one please tell. How we can show alert message on ERP console which is based on groovy scripting?
how to use it in SAP workflow