This example code shows a TestNG implementation of parallel testing on BrowserStack.
There are a few things that you will need before you can get started.
- Maven - use this guide for both Windows and Mac. For anyone having difficulty, this is a more detailed breakdown of the steps.
- Git for pulling down the code - follow this guide for installing Git on all platforms. There are other useful guides on the website mentioned previously. Start here anad follow through to the various links to learn more about Git. It will be very useful on your automation journey. If you have any issues with tokens or user credentials, let me know as this can trip a lot of people up.
- The path branches here. There are 2 options:
- Java JDK - You can download the JDK directly from the Oracle website here. This will allow you to run Java applications on your machine.
- ChromeDriver - this is the web driver that will be used to open Chrome and do the test locally. You can download it from here. Remember to grab the version that matches your installed browser.
To get the project ready to run on your machine, follow the steps below:
- Open a terminal. (Terminal on Mac, Command Prompt on Windows)
- Go to the directory where you want to place the code using cd for Windows, and it functions mostly the same for Mac. You just use "cd" but the folder structure on Mac is different (/Users/username/Documents instead of C:/Users/username/Documents)
- Copy the following command into the terminal, (remember, you must have Git installed)
git clone https://github.com/Manual-To-Automation-Sky-Italia/Lesson-2-Parallel-Testing.git.
- Move into the directory that you just cloned by typing
cd Lesson-2-Parallel-Testing
- To run your test, you can use the Run button in your IDE of choice or right click anywhere in your file and click Run.