free seo tool

Alert Dialog Box Groovy soapUI

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

13 comments:
  • Anonymous says:
    October 31, 2011

    Thank You for your post

  • Anonymous says:
    March 16, 2012

    this is not working !!!

    :(

    Kindly suggest.

  • Sudeesh says:
    March 16, 2012

    Did you try this on "Groovy Script" test step or inside a script assertion?

  • Anonymous says:
    April 08, 2012

    I had tried this in an ERP console which is totally a groovy based Application.

  • Sudeesh says:
    April 10, 2012

    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

  • Anonymous says:
    June 10, 2014

    Thanks for this. I wish I'd known about this class before!

  • SurajAcharya says:
    December 15, 2015

    Nice Post..Simple and useful

  • Unknown says:
    November 23, 2016

    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.

  • Anonymous says:
    March 29, 2017

    Hi all
    extension to this question, how to display alert for certain time. timer based alert.

  • Anonymous says:
    April 04, 2017

    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.

  • Anonymous says:
    January 05, 2018

    Works great!
    How do you use a variable inside the message eg alert.showInfoMessage("myvarhere");

  • Unknown says:
    August 31, 2018

    Can any one please tell. How we can show alert message on ERP console which is based on groovy scripting?

  • Anonymous says:
    October 14, 2020

    how to use it in SAP workflow

Post a Comment

This is a new website mainly for SOA Testers using soapUI. Let me know your thoughts/ suggestions.