Hello there,
Fairly non-technical tester here, who’s looking to reproduce some tests that I completed with Apache JMeter.
I’m ok with Ruby and loved the look of this gem, but I’m finding it a bit tricky to get going, even after reading the tests. Hoping someone can help.
All i need to do is authenticate some users and immediately visit some pages as part of the same session. This is what i have and am wondering if i'm on the completely wrong track.
HTTP.persistent("path" ) { |http|
response = http.post("/j_security_check", :params => {:j_username => "user", :j_password => "password"}).flush
cookie = response["Set-Cookie"][1].split(";")[0].split("=")[1]
%w[reports support tasks].map { |page|
http.get("/#{page}/home.do", :headers => {:cookie => "JSESSIONID=#{cookie}" } ).flush
}
}
I've tried tweaking this a few times and get a 404 which is strange because without the persistent connection I create a manual session in my browser, grab the session id and i can navigate everywhere with;
>> HTTP.cookies(:JSESSIONID => "abc123etc").get(/reports)
>> HTTP.cookies(:JSESSIONID => "abc123etc").get(/support)
>> HTTP.cookies(:JSESSIONID => "abc123etc").get(/tasks)
Sorry if this is really dumb... I’d really appreciate a nudge to get me going with this ruby library before my boss reminds me of time pressure and tells me to “just use wget or something”.
Many thanks
Matt
--
You received this message because you are subscribed to the Google Groups "http.rb: a fast, easy-to-use Ruby HTTP client with a chainable API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to httprb+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.