How To Extract Ticket for HTTPS Java Application

Hi all,

I am aware of Jmeter tool. I used to get ticket using correlation concept.

Am new to Gatling. I recorded a scenario of Https Application. I got a scala file saved . It consists of a launch URL, login and logout actions. When we launch URL, it generates a ticket. I need to use this ticket for a login transaction. How can i use checks concept to extract Ticket.

Thanks & Regards

It would probably be good for you to share two snippets from your scenario:

  1. The request from your scenario that generates the ticket and what you expect the response to be
  2. A request from your scenario that shows how you use the generated ticket

Hi Spencer Chastain,

This is the Gatling recorder script.

val httpProtocol = http
.acceptEncodingHeader(“gzip, deflate”)
.userAgentHeader(“Mozilla/5.0 (Windows NT 5.1; rv:26.0) Gecko/20100101 Firefox/26.0”)

.param(""“username”"", “”“abc”"")
.param(""“password”"", “”“abcpwd”"")
.param(""“lt”"", “”“LT-828-wppjtrEoGU6gj9UVFt3soVqQ3mLMwe”"")
.param(""“execution”"", “”“e1s1"”")
.param("""_eventId""", “”“submit”"")
.param(""“submit”"", “”“LOGIN”""))

If We see these three lines
.param(""“username”"", “”“abc”"")
.param(""“password”"", “”“abcpwd”"")
.param(""“lt”"", “”“LT-828-wppjtrEoGU6gj9UVFt3soVqQ3mLMwe”"")
we will use parametrization for username and password. these are input values we can get from a csv file while running the test. Here “lt” is the parameter for ticket. it was generated by CAS when we Launch the URL.

The following code is the portion of BaseURL response.



Warn me before logging me into other sites.

Here CAS generated ticket "LT-828-wppjtrEoGU6gj9UVFt3soVqQ3mLMwe" in BaseURL Response. Here, I need to extract ticket from the BaseURL Response and use this ticket in Login request.

Previous i extracted ticket using regular expression in Jmeter as name=“lt” value="(.*?)" from BaseURL Response.

Please help me how to extract ticket in Gatling.

Thanks & Regards

Please read the Check documentation: