This open source code is for use in workshops.
See LICENSE file for details.
Git clone this repo and check out the branch that represents your workshop
Git is a version control system that lets you check out code from a repository, work with that code on your own branch, and then merge that code with any changes that have been made by other developers. Git is an essential tool for distributed development teams, and is a critical component of the continuous integration/continuous development toolchain.
MacOSX (screen cast):
- Go to https://git-scm.com/downloads.
- Under Downloads, click Mac OS X.
- When the download completes, double-click the
.dmg
file open the installer package. - Double-click the installer package to begin the installation.
Security Warning
You may see a warning message that the package can't be opened because it's not from a recognized developer. If this happens, go to System Preferences > Security and Privacy Settings, and click Open Anyway.
- Click Continue for the installation, and enter your local password to authorize the installation.
Windows (screen cast):
- Go to https://git-scm.com/downloads
- Under Downloads, click on Windows.
- When the dialog opens asking if you want to allow the app to make changes to your device, click Yes.
- Follow the steps in the setup wizard to complete the installation. You should accept all the default settings.
IntelliJ is an integrated development environment that incorporates several tools for developing and running Java code. You will be using IntelliJ to write and edit the sample Selenium scripts used in the exercises. For these exercises you only need to download the free Community edition.
MacOSX (screen cast):
- Go to https://www.jetbrains.com/idea/
- Click Download.
- On the Downloads page, select macOS.
- Under Community, click Download.
- When the download completes, double-click the .dmg file open the installer package.
- Double-click the installer package to begin the installation.
- Drag and drop the IntelliJ icon into the Applications folder.
Windows (screen cast):
- Go to https://www.jetbrains.com/idea/
- Click Download.
- On the Downloads page, select Windows.
- Under Community, click Download.
- When the download completes, double-click the
.exe
file to launch the installation wizard. You should accept all the default settings.
The Java SE Developer Kit lets you develop and deploy Java applications on desktops and servers. It is needed to compile our test code.
MacOSX (screen cast):
- Go to http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
- Under Java SE Development Kit 8u161, select Accept License Agreement.
- Click the download link for Mac OS.
- When the download completes, double-click the
.dmg
file open the installer package. Double-click the installer package to begin the installation.
Windows (screen cast):
- Go to http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
- Under Java SE Development Kit 8u161, select Accept License Agreement.
- Click the download link for Windows x64.
- When the download completes, double-click the
.exe
file open the installer package. - Double-click the installer package to begin the installation. You should accept all the default settings.
-
Downloading the Project Files
- Go to https://github.com/saucelabs-training/brussels-basic-framework/releases.
- Download and extract the latest
tutorial_mac.zip
file, or the one that matches the name of your workshop.You can save the zip file to any directory you want, including Downloads. You will just need to remember the directory when you want to open the tutorial files in IntelliJ.
-
Opening the Project in IntelliJ
- Launch IntelliJ.
- Click Open.
- Browse to the junit_tests directory, and click Open.
- Click the Sidebars icon in the lower left corner of IntelliJ to open the sidebars.
- Open the Project sidebar and expand the directories lib > src > test.
- In the test/examples directory, double click SeleniumScript, and a sample file will load into the editor window.
-
Configure the Project SDK
When the file loads, you'll see a notification at the top of the file that the SDK for the project is not defined.
- Click Setup SDK, and then Configure.
- Click + in the Configure SDK dialog.
- Select Java SDK.
- Browse to the directory where you installed the Java SDK and click OK. IntelliJ will load all the
.jar
files for the SDK. - Click OK when the installation completes.
-
Confirm that Selenium is Running
- In the file list on the left, right-click on the SeleniumScript file.
- Select Run 'SeleniumScript'.
You should see the code begin to build, and then a console window will open. You should see that the driver opens and closes a browser, confirming that the Selenium environment is running on your local machine.
-
Ensure Git is properly configured
- Click the terminal tab on the bottom left of IntelliJ
- Type the following commands into the terminal, replacing the example information with your own
$ git config --global user.name "John Doe" $ git config --global user.email johndoe@example.com
-
Downloading the Project Files
- Go to https://github.com/saucelabs-training/brussels-basic-framework/releases.
- Download and extract the
tutorial_windows.zip
file, or the one that matches the name of your workshop.You can save the zip file to any directory you want, including Downloads. You will just need to remember the directory when you want to open the tutorial files in IntelliJ.
-
Opening the Project in IntelliJ
- Launch IntelliJ.
- Click Open.
- Browse to the projects > junit_tests directory you created, and click OK.
- Click the Sidebars icon in the lower left corner of IntelliJ to open the sidebars.
- Open the Project sidebar.
- In the Project sidebar, expand the directories junit_tests > lib > src > test > examples.
- Select SeleniumScript, and a sample file will load into the editor window.
-
Configure the Project SDK
When the file loads, you'll see a notification that the SDK for the project is not defined.
- Click Setup SDK, and then Configure.
- Click + in the Configure SDK dialog.
- Select Java SDK.
- Browse to the directory where you installed the Java SDK and click OK. IntelliJ will load all the
.jar
files for the SDK. - Click OK when the installation completes.
-
Confirm that Selenium is Running
- In the file list on the left, right-click on the SeleniumScript file.
- Select Run 'SeleniumScript'.
You should see the code begin to build, and then a console window will open. You should see that the driver opens and closes a browser, confirming that the Selenium environment is running on your local machine.
-
Ensure Git is properly configured
- Click the terminal tab on the bottom left of IntelliJ
- Type the following commands into the terminal, replacing the example information with your own
$ git config --global user.name "John Doe" $ git config --global user.email johndoe@example.com