Forum Discussion

alokraj001's avatar
alokraj001
New Contributor
9 years ago

How to click a link in webpage through groovyscript using soapui tool.

Hi,
I am working on a project ,which require functional testing of a website through soapUI.
Following are the functionality i have to test.

1) First webpage will have login verification.

2) after login i will get another page which will have some links

3) I have to trigger a click event on the links through groovy scripts using soapui tool.

 

Please help.I am new to soap ui tool and groovy script.Thanx in advance.

3 Replies

  • 05ten's avatar
    05ten
    Contributor

    I would recommend you to have a look at the Geb framework.

    I think it can do almost exactly what you want it to. 

     

    @Grapes([
    @Grab("org.codehaus.geb:geb-core:0.7.0"),
    @Grab("org.seleniumhq.selenium:selenium-firefox-driver:2.15.0"),
    @Grab("org.seleniumhq.selenium:selenium-support:2.15.0")
    ])
    import geb.Browser   Browser.drive {     go "http://myapp.com/login"           assert $("h1").text() == "Please Login"           $("form.login").with {         username = "admin"         password = "password"         login().click()     }           assert $("h1").text() == "Admin Section" }

    For more in-depth guidance i can strongly recommend their online docs

     

    • alokraj001's avatar
      alokraj001
      New Contributor

      Thanx Osten for your reply.But I have to do it through SOAPUI tool.

      • nmrao's avatar
        nmrao
        Champion Level 3
        Osten had provided you the groovy script right? Have you tried it? And am sure you know how to run groovy script in soapui tool.