Selenium is built for exercising browsers in a similar manner to that of an end user, and it's great for functional testing. As many of us have realized, Selenium is not great at non-functional testing, whether that be layout, usability, performance, or other types of testing. But that doesn't mean that your tests themselves can't be repurposed to assist in these areas. Join Max in a hands on workshop to learn some techniques on how to expand the testing your Selenium scripts can accomplish.
Max will cover 3 techniques: how to get security results by running Selenium tests, how to retrieve accessibility results from pages you test, and how to transform your Selenium tests into performance tests. Come with a laptop as we will walk through examples, and leave with a better understanding how to expand your testing coverage, with minimal additional effort.
The below tools and programs need to be installed on the machine before starting the workshop
Note that in the following instructions, if a version other than Java 8u265 is installed (which is fine, download the latest Java 8 version), the file names below will differ in the version number (8u265 or 1.8.0_265).
You must have administrative permissions in order to install the JDK on Microsoft Windows.
- Navigate to RedHat's site to download the latest version of OpenJDK.
- Find the correct
msi
for your Windows system. If you instead want to install thezip
follow instructions here - If you downloaded either file instead of running it directly from the website, double-click the installer's icon.
- Follow the instructions the installer provides.
- When finished with the installation, you can delete the downloaded file to recover disk space.
- Open a terminal window
- Install openjdk via
apt
sudo apt-get install openjdk-8-jdk
- Open a terminal window
- Install openjdk via
apt
su -c "yum install java-1.7.0-openjdk"
We will be using brew
to install openjdk 8 from a terminal window
- Open a terminal
- Run the following command to checkout the correct openjdk
version
brew tap AdoptOpenJDK/openjdk
- Run the following command to find the correct openjdk
version
brew search /adoptopenjdk/
- Copy the displayed line that has openjdk8 listed, and run brew install
with it. For example:
brew install adoptopenjdk/openjdk/adoptopenjdk-openjdk8
Open a new command prompt (in windows use Windows Key + R then type cmd)
Run javac -version
to verify that it is correctly installed. This command will
display the currently installed version of Java.
Download Maven from the Apache website at this link. At time of this writing, the current version is 3.6.3, but feel free to use a later version. Note that if a later version is installed, then the version numbers in the file names below will need to use that version.
- Unzip the distribution archive to a directory easy to find on the file system.
These instructions assume this directory will be
C:\Program Files\
. The subdirectoryapache-maven-3.6.3
will be created from the archive. - Add the
M2_HOME
environment variable by opening up the system properties (this can be done through the Control Panel or by using the Windows Key + Pause), selecting the "Advanced" tab, and the "Environment Variables" button, then adding theM2_HOME
variable in the user variables with the valueC:\Program Files\apache-maven-3.6.3
. Be sure to omit any quotation marks around the path even if it contains spaces. - In the same dialog, add the
M2
environment variable in the user variables with the value%M2_HOME%\bin
. - In the same dialog, update/create the
Path
environment variable in the user variables and prepend the value%M2%
to add Maven available in the command line. - In the same dialog, make sure that JAVA_HOME exists in your user variables or
in the system variables and it is set to the location of your JDK, e.g.
C:\Program Files\Java\jdk1.8.0_261
and that%JAVA_HOME%\bin
is in yourPath
environment variable.
- Extract the distribution archive to the directory you wish to install Maven 3.6.3.
These instructions assume you chose
/usr/local/
. The subdirectoryapache-maven-3.6.3
will be created from the archive. - In a command terminal, add the
M2_HOME
environment variable:export M2_HOME=/usr/local/apache-maven/apache-maven-3.6.3
- Add the
M2
environment variable:export M2=$M2_HOME/bin
- Add
M2
environment variable to your path:export PATH=$M2:$PATH
- Make sure that
JAVA_HOME
is set to the location of your JDK; this was done during the installation of Java above.export JAVA_HOME=/usr/java/jdk1.8.0_261
and that$JAVA_HOME/bin
is in yourPATH
environment variable:echo $PATH
Open a new command prompt (in Windows use Windows Key + R then type cmd) and run
mvn --version
to verify that it is correctly installed. This should display
something like the following:
Apache Maven 3.6.3
Maven home: /usr/share/maven
Java version: 1.8.0_261, vendor: Private Build, runtime: /usr/lib/jvm/java-8-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.4.0-47-generic", arch: "amd64", family: "unix"
- Navigate to git downloads
- Select the operating system you are running
- If Windows or Mac, run the installer
- If Linux, follow the provided instructions
Open a new command prompt (in windows use Windows Key + R then type cmd)
Run git --version
to verify that it is correctly installed. This command will
display the currently installed version of Git.
- Navigate to chrome downloads
- Click on the “Download Chrome” button. The appropriate installation package for your operating system will be automatically downloaded
- Once the download is done, run the installer and, unless there is a known reason, accept all defaults.
Note that Chrome is not required for this workshop, but a modern browser is. The exercises will need to be modified slightly for usage with other browsers.
Note that any Java capable IDE can work. If you have Eclipse, NetBeans, or some other Java friendly IDE, IntelliJ does not have to be installed. That said, be sure to be familiar with your IDE, as the instructor might have limited support based on the chosen IDE.
- Navigate to Intellij
- You should be forwarded to the section for your current system setup
- Download the Community version (Free, open source)
Simply launch the provided installer. Default settings are almost always appropriate.
Extract the distribution archive to the directory you wish to install IntelliJ.
These instructions assume you chose /usr/local/
. The subdirectory idea-IC-VERSION
will be created from the archive.
Download the latest Zed Attack Proxy version from ZAP’s website at this link. At time of this writing, the current version is 2.9, but feel free to use a later version. Click the download link for the computer system you are running.
Launch the installer you downloaded, either the .exe, .dmg, or shell script, depending on the download you selected based on your computer system (you might need to add execute permissions to the file for Linux systems). Follow the installation instructions. Once the installation is complete, launch ZAP and read the license terms. Click Agree if you accept the terms, and ZAP will finish installing, then ZAP will automatically start.
Download the latest JMeter version from apache’s website at this link. Select the link for either the tgz or zip, depending on whichever compressed file type you are comfortable handling. Unzip the zip/tar file into the directory where you want JMeter to be installed.
- Exercise 1: Functional Testing
- Exercise 2: Security Testing
- Exercise 3: Accessibility Testing
- Exercise 4: Performance Testing