I’ll be setting up Cucumber test to run with Eclipse in macOS with chromedriver. I’m using Macbook with M1 chip, hence I’ll be dowloading the AArch64 version.
Once successfully installed Eclipse IDE, go to Eclipse Marketplace under the Help menu to install
- Cucumber Eclipse Plugin
- TestNG for Eclipse
Create a Mavenproject
Filter by maven-archetype-quickstart
Open pom.xml to add dependencies. Go to mvnrepository.com to search for these dependencies to add. Choose the latest version available.
- cucumber-java
- cucumber-testng
- selenium-java
Create a structure like this, under src/test/java create these packages
- cucumberOptions
- features
- stepDefinitions
Contents of the files shown below.
In line 18 for MyStepDefinitions.java , you will need to change the path where you place your chromedriver. Go to google and search for “chromedriver download”. You will find yourself in a similar page like below. In my case, I’ll be choosing chromedriver for mac-arm64.
Run the testNG test.
Test ran successfully. It went to Wikipedia homepage, search for “iPhone” and found a page titled “iPhone”.