How to setup the Java JDK for use with Ranorex Webtestit


#1

Note: since JDK version 9 and 11 are not currently supported for building Selenium, we strongly advise you to install and use the JDK 8 version. Otherwise, you might end up with an error when trying to execute your tests. You can find more information about this here

  1. Download and Install JDK
  2. Restart Ranorex Webtestit

Ranorex Webtestit automatically detects your JDK installation and sets the required JAVA_HOME variable path. If you have multiple JDK´s installed, Ranorex Webtestit will use your latest JDK version.

If for some reason, the JAVA_HOME variable was not set automatically, and you get a warning message regarding the variable during project creation, you can set the variable manually by following the instructions below:

Set the JAVA_HOME variable on Windows

After you’ve installed Java in Windows, you must set the JAVA_HOME environment variable to point to the Java installation directory.

To set the JAVA_HOME variable:

  1. Locate your Java installation directory (It will be something like C:\Program Files\Java\jdk1.8.0_65)
  2. Do one of the following:
    Windows 7 – Right-click My Computer and select Properties > Advanced
    Windows 8 – Go to Control Panel > System > Advanced System Settings
    Windows 10 – Search for Environment Variables then select Edit the system environment variables
  3. Click the Environment Variables button.
  4. Under System Variables, click New.
  5. In the Variable Name field, enter JAVA_HOME
  6. In the Variable Value field, enter your JDK installation path.
  7. Click OK and Apply Changes as prompted

Screenshots:

Open “System Properties”

Open “Environment Variables”

image

Add System variable “JAVA_HOME”

Restart Ranorex Webtestit

More information on setting the JAVA_HOME.

Set the JAVA_HOME variable on MAC OS X

  1. Open up Terminal.app (Applications >> Utilities >> Terminal)
  2. Type: emacs .profile
  3. add this to the end of the .profile file:

JAVA_HOME=/Library/Java/Home
export JAVA_HOME;

  1. Save and exit emacs (ctrl-x, ctrl-s; ctrl-x, ctrl-c)
  2. Open a new Terminal window (cmd-n) and type: $JAVA_HOME/bin/java -version
  3. Restart Ranorex Webtestit

To install JDK and configure JAVA_HOME variable on Linux

  1. Download the appropriate version of JDK from here
  2. Create a folder in which you want to install JDK and move the downloaded JDK installation file there.
  3. Open Terminal and navigate to your install folder.
  4. In Terminal, type in next lines :
  • If you downloaded the tar.gz archive: tar zxvf (downloaded package name) for example
    tar zxvf jdk-8u181-linux-x64.tar.gz
  • If you downloaded the .rpm file : rpm -ivh (downloaded package name) for example
    rpm -ivh jdk-8u181-linux-x64.tar.gz

After this, you should see the installation progress and JDK should now be installed.

To set the JAVA_HOME path:

  1. If you don’t have it, install a nano text editor
  2. Open the terminal and type in:
    sudo nano /etc/environment
  3. Add following lines to the document:

JAVA_HOME= (enter here the location where you have installed JDK)
export JAVA_HOME

  1. Save the file.
  2. Lastly, reload the system PATH with the following command:
    $ . /etc/environment

The JAVA_PATH should now be set. Type: echo $JAVA_HOME to verify it.


Unable to import Java Packages
Running Ranorex Webtestit in Jenkins for Continuous Integration
Couldn't update test report
Creating a new project: Installing Node.js link points to wrong setup guide
Running Ranorex Webtestit in TFS/VSTS for Continuous Integration