Created
January 27, 2015 03:10
-
-
Save mallim/460ef038db160a3b4cb3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.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