how to extract part of HTML page using Groovy
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2019
04:37 AM
04-18-2019
04:37 AM
how to extract part of HTML page using Groovy
How to Extract Part of HTML Page using Groovy Script ?
3 REPLIES 3
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2019
04:49 AM
04-18-2019
04:49 AM
You should be able to find the sample code snippets online.
Such as
https://binarybuffer.com/post/2012-05-09-parsing-html-pages-like-a-boss-with-groovy/
May be you want to precise more ?
Regards,
Rao.
Such as
https://binarybuffer.com/post/2012-05-09-parsing-html-pages-like-a-boss-with-groovy/
May be you want to precise more ?
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2019
01:19 AM
04-19-2019
01:19 AM
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 htmlParse.select("input").each { if (it.attr("name") == "xxxxxx") { // get value log.info java.net.URLEncoder.encode(it.attr("value"), "UTF-8) } }
BR,
/Aaron
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2019
07:51 AM
04-22-2019
07:51 AM
basically i have a project report on HTML created on projectfolder
I need only TestSuite results page to be extract - any help ?
