Forum Discussion

678's avatar
Regular Contributor
5 years ago

how to extract part of HTML page using Groovy

How to Extract Part of HTML Page using Groovy Script ? 


3 Replies

  • aaronpliu's avatar
    Frequent Contributor

    Hi 678 ,

    Suggest to use jsoup (ReadyAPI contains this jar in /lib)


    // extract node value if need
    import org.jsoup.*
    def htmlResponse = testRunner.testCase.testSteps["YourStepName"].testRequest.response.contentAsString
    def htmlParse = Jsoup.parse(htmlResponse)
    // for example, retrieve value from "input" node"input").each {
        if (it.attr("name") == "xxxxxx") {
            // get value
  "value"), "UTF-8)




    • 678's avatar
      Regular Contributor

      basically i have a project report on HTML created on projectfolder 


      I need only TestSuite results page to be extract - any help ?