1

I'm doing my first steps with JMeter and trying to write a small Test, which opens a page, logs in and checks if some text is displayed.

For this I created the following test, based on apache login example

  1. Constant Timer
  2. HTTP Cache Manager
  3. HTTP Cookie Manager
  4. HTTP-Request "Check login page"
    • Servername
    • Protocoll: https
    • Path: login.xhtml
    • Method: GET
    • Port: empty/default
  5. Once Only Controller
    • HTTP-Request "Do login"
      • Servername
      • Protocoll: https
      • Path: login.xhtml
      • Method: POST
      • Port: empty/default
      • Parameters and values for j_username and j_password
    • Response Assertion with text chec (as child of the HTTP-Request "Do login")
  6. Interleave Controller
    • HTTP-Request "Welcomepage" and Assertion
  7. Assertion Results
  8. View Results Tree

The login form only consists of (except css styles and labels):

<form id="loginForm" action="j_security_check" method="post">
  <input id="j_username" name="j_username" type="text" tabindex="1" aria-required="true"/>
   <input id="j_password" name="j_password" type="password" tabindex="2" aria-required="true"/>
</form>

When execution I can successfuly do the HTTP-Request "Check login page" (Step 4) but the step about "Do login" failes with

Response code: Non HTTP response code: javax.net.ssl.SSLHandshakeException Response message: Non HTTP response message: Remote host closed connection during handshake

So maybe the same question like this, where no useful answer was posted

Some information:

  • Page is located in intranet, so no proxy is needed
  • Page is fully accessable using browsers
  • Please no comments like "Use BlazeMeter-Plugin" - it's an internal page and therefor not allowed to be recorded into any external cloud
  • To be honest I don't want to use the JMeter record Proxy, because I want to understand what happens and how I can create things and not only execute some recorded stuff
  • My thread groups only consists of one thread and user, so it can't be a problem like described in this SO-question
  • JMeter 3.1 (2017-03-31) and Java 1.8

Maybe it has something to do with another form on the page, but as far as my HTML knowledge isn't outdated only one form per page can be submitted?!?

<form id="footerForm" name="footerForm" method="post" action="login.xhtml" enctype="application/x-www-form-urlencoded"> 
  <input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="<very long string, like base64 or something like that>">
</form>

If I also have to submit the second one - how can I do this?

1 Answer 1

0

You have 2 points to handle:

  1. Deal with HTTPS problem. It may have several reasons behind, like:

    • Mismatch between server and JMeter HTTPS protocol (TLS, SSLv2, SSLv3, etc.). You need to figure out the required configuration and amend JMeter's https.default.protocol and/or https.socket.protocols accordingly
    • Your application expects client SSL certificate. Check out SSL Manager documentation and How to Set Your JMeter Load Test to Use Client Side Certificates for details.
  2. Extract this javax.faces.ViewState hidden input value, save it into a JMeter Variable and pass the variable along with credentials. You can do it using i.e. Regular Expression Extractor, the relevant regular expression would be something like:

    <input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="(.+?)"
    
2
  • Thank you for you answer. It is helpful even if I don't get it do work because I don't know which certificate the site is using. The certificate chrome shows me is a server-side cert, but I don't know which client cert my browser uses for this. Also I still don't understand why I can open the page without any ssh-problems (see step 4) but don't login (step 5) both using jmeter. Seems like I must try using Selenium which uses the browser itselfs and not trying to "programm" ist with jmeter, even selenium is not made for run 100 threads.
    – bish
    Apr 5, 2017 at 6:02
  • All tutorials also say to save the server side certifcate as a *.p12 and use it in SSL Manager. But chrome only offers to me save the certificate in cer or p7 format - and even then I don't know the password for it.
    – bish
    Apr 5, 2017 at 6:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.