I am running Jmeter in noVNC, able to run Jmeter in noVNC but offcourse in default small window. But when I create Http(s) script recorder and when click on Start button, I get this error

error is -> "Could not create script recorder -see log for details: >> keytool error: java.security.ProviderException: Could not initialize NSS << command failed code:1 'keytool -genkeypair -alias:root_ca: -dname"CN=_Jmeter Root CA for recording(INSTALL ONLY IF IT IS YOURS).......FULL ERROR in SCREENSHOT"'"

Tried creating Http(s) script recrorder with and without PRoxy setup in my Chrome browser, getting same error.

enter image description here

right hand side of screenshot enter image description here

below is my Dockerfile

FROM uphy/novnc-alpine
RUN \
    apk add --no-cache curl openjdk8-jre bash \
    && apk add --no-cache nss \
    && curl -L https://archive.apache.org/dist/jmeter/binaries/apache-jmeter-5.4.1.tgz >  /tmp/jmeter.tgz \
    && mkdir -p /opt \
    && tar -xvf /tmp/jmeter.tgz -C /opt \
    && rm /tmp/jmeter.tgz \
    && cd /etc/supervisor/conf.d \
    && echo '[program:jmeter]' >> supervisord.conf \
    && echo 'command=/opt/apache-jmeter-5.4.1/bin/./jmeter' >> supervisord.conf \
    && echo 'autorestart=true' >> supervisord.conf
ENV JAVA_HOME /usr/lib/jvm/java-1.8-openjdk/
RUN export JAVA_HOME

This is how I am running (related to Use Jmeter desktop application as web app)

  1. creating docker image with noVNC and running Jmeter inside noVNC (dockerfile also provided in the end)
  2. exposing it to some port and accessing it in browser
docker build -t jmeter .
docker run -it --rm -p 8080:8080 jmeter
  1. I checked my docker container also, able to see JDK, jdk is already present here -> /usr/lib/jvm/java-1.8-openjdk/ and jmeter is present here /opt/apache-jmeter-5.4.1
  2. I am not sure should I pass more options or arguments inside docker run command.
  3. I am wondering, how this jmeter will create the certificate inside my bin directory on click of start button, since this Jmeter is running inside noVNC docker ?
  4. Any other way by which we can automatically integrate/create this certificate without importing or without clicking on start button.
  5. How Proxy setting can be done if Jmeter in running inside noVNC container.
1

There are 1 answers

2
Dmitri T On

I think you need to install nss package

change this line:

apk add --no-cache curl openjdk8-jre bash \

to this one:

apk add --no-cache curl openjdk8-jre bash nss \

Once you re-build the image the HTTP(S) Test Script Recorder should launch normally.

With regards to the certificate, it will be stored in JMeter's "bin" folder in the container so if you want to use in in the browser in the container - you will have to install the browser there as well.

If you want to use the browser on your local machine - you will need to copy the certificate from the container and to expose another port for JMeter's HTTP(S) test script recorder.

Just in case be aware that you can also record JMeter test scripts using JMeter Chrome Extension, in this case you won't have to worry about proxies, certificates and ports.