Skip to content

Instantly share code, notes, and snippets.

@mallim
Created January 27, 2015 03:10
Show Gist options
  • Save mallim/460ef038db160a3b4cb3 to your computer and use it in GitHub Desktop.
Save mallim/460ef038db160a3b4cb3 to your computer and use it in GitHub Desktop.
.exec(http("Goto Your Desired URL")
.get("http://THIS_SHOULD_BE_YOUR_URL")
.check(
status.is(200),
bodyString.saveAs("responseBody")
)
)
.exec(
session => {
// You can do whatever you want with the string
var htmlText = session( "responseBody" ).as[String]
var index = htmlText.indexOfSlice("SOME_SEARCH_VALUE")
var TXNO = htmlText.substring( index, index + 16 )
println( "TXNNO in SESSION: " + TXNO )
// Set the output back to session
session.set( "TXNNO", TXNO )
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment