SoapUI Pro(Ready API) Part 20-How to Send Request & Verify Response using Groovy Script

Поділитися
Вставка
  • Опубліковано 15 жов 2024
  • Topic : How to Send Request & Verify Response using Groovy Script
    ----------------------------------
    1) Create WSDL Project
    www.dneonline.c...
    2) create custom properties at test case level and pass them as params
    3) Add GroovyScript step
    4) Write groovy code for sending request
    5) Write groovy code for getting response
    6) Insert assertion
    Groovy Script:
    -------------------------
    import com.eviware.soapui.support.XmlHolder
    import com.eviware.soapui.impl.wsdl.testcase.WsdlTestRunContext
    //How to send Request
    def xmlreq=testRunner.testCase.testSteps["Add"].getPropertyValue("Request")
    def a=testRunner.testCase.getPropertyValue("a")
    def b=testRunner.testCase.getPropertyValue("b")
    int aval=a.toInteger()
    int bval=b.toInteger()
    log.info aval+bval
    def samplexmlreq=new XmlHolder(xmlreq)
    samplexmlreq.setNodeValue("//tem:Add/tem:intA",a)
    samplexmlreq.setNodeValue("//tem:Add/tem:intB",b)
    def finalXML=samplexmlreq.getXml()
    def addReqTest=testRunner.testCase.testSteps["Add"]
    def contextAddReqTest= new WsdlTestRunContext(addReqTest)
    addReqTest.run(testRunner,contextAddReqTest)
    //Verify XML Response
    def addXMLResponse=testRunner.testCase.testSteps["Add"].getPropertyValue("Response")
    def addXMLResponseFinal=new XmlHolder(addXMLResponse)
    def responseValue=addXMLResponseFinal.getNodeValue("//*:AddResult")
    //Assertion
    assert responseValue.toInteger()==aval+bval
    #########################
    Udemy Courses:
    #########################
    Manual Testing+Agile with Jira Tool
    ****************
    ► shorturl.at/xNXZ4
    Selenium with Java+Cucumber
    *****************
    ► shorturl.at/aIKMW
    Selenium with Python & PyTest
    ******************
    ► shorturl.at/ELW09
    Selenium with python using Robot framework
    ********************
    ► shorturl.at/bcDPZ
    API Testing(Postman, RestAssured & SoapUI)
    ********************
    ► shorturl.at/uAWY7
    Web & API Automation using Cypress with Javascript
    *******************
    ► rb.gy/4uum2n
    Playwright with Javascript
    ******************
    ► shorturl.at/gALZ1
    Jmeter-Performance Testing
    ***************
    ► rb.gy/ocj7r2
    SDET Essencials(Full Stack QA)
    *************
    ► rb.gy/hlnf2v
    Appium-Mobile Automation Testing
    ****************
    ► rb.gy/wmzv64
    Java Collections
    *****************
    ► bit.ly/3S66ezE
    Python Programming
    *****************
    ► urlis.net/gdsf...
    Cucumber BDD Framework
    ***************
    ► bit.ly/3F7d69r
    Protractor with Javascript
    ***************
    ► urlis.net/4udd...
    ####################################
    UA-cam Playlists:
    ####################################
    Manual Testing & Agile
    ************
    ► bit.ly/3ujvaYa
    ► bit.ly/3OYzxQj
    SQL
    ****
    ► bit.ly/3R6XjeG
    ► bit.ly/3nE0a1s
    ► bit.ly/3IeKuuJ
    linux & Shell Scripting
    ************
    ► bit.ly/3up1Z6a
    ► bit.ly/3nzvGxx
    Java
    *****
    ► bit.ly/3R9QfOs
    ► bit.ly/3AoRMKM
    ► bit.ly/3IbTTDn
    ► bit.ly/3ybXInv
    ► bit.ly/3yCoHdw
    Selenium With Java+Cucumber
    *****************
    ► bit.ly/3P2FMm4
    ► bit.ly/3yhiIt4
    ► bit.ly/3uokzet
    ► bit.ly/3a7XIND
    ► bit.ly/3umN2S9
    ► bit.ly/3aar7GW
    ► bit.ly/3y9kD2S
    ► bit.ly/3uhLskn
    Python
    *******
    ► bit.ly/3agNgU0
    ► bit.ly/3NJNnoy
    ► bit.ly/2CTQ4mR
    ► bit.ly/3OIYWh1
    Selenium With Python,Pytest&Behave
    *******************
    ► bit.ly/3OHHoC9
    ► bit.ly/3IeNLdv
    ► bit.ly/2J4tPeT
    ► bit.ly/3ydSkAq
    Selenium With Python Using Robert Framework
    (Web&API Testing)
    *****************************
    ► bit.ly/3nUvlpr
    ► bit.ly/3nUvE3z
    API Testing (Postman,SoapUi,&Rest Assured)
    ************************************
    ► bit.ly/3OXacWY
    ► bit.ly/3yh0UhE
    ► bit.ly/3nC9DWQ
    ► bit.ly/3yGfhNS
    ► bit.ly/3OJa11H
    ► bit.ly/3P2slCC
    Mobile App Testing Appium
    ****************************
    ► bit.ly/3Al49HG
    Performance Testing Jmeter
    *******************************
    ► bit.ly/3nz4fE7
    Maven,Jenkins,Git,Github,CI/CD
    *******************************
    ► bit.ly/3P16HPj
    ► bit.ly/3yhlUVA
    ► bit.ly/3afYfwT
    ► bit.ly/3yGzweG
    ► bit.ly/3yF73Ws
    ► bit.ly/3NCOmH7
    SQL,DB Testing&ETL,Bigdata
    *******************************
    ► bit.ly/3NKOcNY
    ► bit.ly/3OVpDyI
    ► bit.ly/3NEvUy0
    ► bit.ly/3IryxlT
    ► bit.ly/3RkWBLh
    JavaScript Based Automation Tools
    ********************************
    ► bit.ly/3nUx51X
    ► bit.ly/3AqI6Q0
    ► bit.ly/3yeurbT
    ► bit.ly/3ujzpTK
    Selector Hub Tools
    ********************
    ►rb.gy/h3h424
    GraphQL
    ******************
    ► rb.gy/sj3gys
    Cypress API Testing
    ********************
    ► shorturl.at/fjKPX
    Cypress Web Testing
    ********************
    ► shorturl.at/agjlK
    Playwright with Javascipt
    ************************
    ► shorturl.at/adSTY

КОМЕНТАРІ • 18

  • @nehapatel1811
    @nehapatel1811 2 роки тому

    Hello Sir and all,
    I am looking to save my request (which is sent in Json format) into external file .json format .
    Please any help will be appreciated!

  • @sukhwinderkaur9390
    @sukhwinderkaur9390 4 роки тому +1

    Thanks for this video. Could you please upload more videos on Ready API?

    • @thotasathishkumar
      @thotasathishkumar 2 роки тому

      Are you working on ReadyAPI? I am looking for support.

  • @abhijeetsingh089
    @abhijeetsingh089 Рік тому

    Sir I saw this video which was immensely helpful but still I have one doubt related to my project
    Sir I want to get a code in SOAP UI using GROOVY SCRIPTING to get the response of one soap request and paste it in the request of another SOAP request without any manual intervention i.e. automatically using getproperty and setproperty in groovy script of soap ui
    Please help me with the same

    • @ahambrahmasmi1905
      @ahambrahmasmi1905 4 місяці тому

      Can you fere some useful videos on ReadyAPI, please ping the links of name

  • @madhusudandevaraju1207
    @madhusudandevaraju1207 4 роки тому +1

    Hi, Can you please make a video for the read-write an excel file in the groovy test step?

    • @Safg348
      @Safg348 2 роки тому

      YES I WISH PAVAN SIR DO THAT

  • @Safg348
    @Safg348 2 роки тому

    @SDET Can you please do more videos groovy with ReadyAPI

  • @vivekdubey1513
    @vivekdubey1513 4 роки тому +1

    Font is too small while explaining groovy scripting ,can't understand what you are typing

    • @johnjoe6168
      @johnjoe6168 3 роки тому

      If you click Show more under the channel name, the steps and the script is there

  • @johnnyjohn9134
    @johnnyjohn9134 4 роки тому

    Hello sir, do You have java courses for begginers?! Thank You!

  • @Jyotichauhan-v4s
    @Jyotichauhan-v4s Рік тому

    can we integrate BDD in Ready API ? can anybody help?

  • @priteshkhambekar
    @priteshkhambekar Рік тому

    How we can write groovy script in SOAPUI to send the request and Verify the response if we have RESTAPI?
    In this video we did same but with SOAP API.

  • @arunsanga6433
    @arunsanga6433 3 роки тому

    Thanks 🙏😊

  • @jitttttt
    @jitttttt 3 роки тому +1

    such a long script for just sending a request & and verify response of a very simple operation.