Note| Text in Blue [#PYTHON] and Orange [#JAVA] can be edited or mentioned important for the entire blog. All the posts are practically done by me.
Cucumber BDD Framework | selenium
1| Add an Eclipse plugin, Cucumber Eclipse feature using the below URL,
http://cucumber.github.com/cucumber-eclipse/update-site
2| Help > install new software... > paste the above url in work with text field and press enter key.
3| After the installation is done, restart Eclipse IDE.
4| Create a Maven project and add the following dependencies in POM.xml file
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>BDD</groupId>
<artifactId>Cucumber</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Cucumber</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<encoding>UTF-8</encoding>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.2</version>
<configuration>
<useFile>false</useFile>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
<version>2.41.0</version>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-core</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-java</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-junit</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-html</artifactId>
<version>0.2.2</version>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>gherkin</artifactId>
<version>2.11.6</version>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<version>1.3</version>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>gherkin</artifactId>
<version>2.11.6</version>
</dependency>
<dependency>
<groupId>com.rubiconproject.oss</groupId>
<artifactId>jchronic</artifactId>
<version>0.2.6</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
5| Now, create a test run class file
package BDD.Cucumber;
import org.junit.runner.RunWith;
import cucumber.api.junit.Cucumber;
@RunWith(Cucumber.class)
@Cucumber.Options(format = {"pretty", "html:target/cucumber","json:target/cucumber.json"})
public class RunTest {
}
6| Now, create a test class file
package BDD.Cucumber;
import static org.junit.Assert.assertEquals;
import java.util.concurrent.TimeUnit;
import org.junit.Assert;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import cucumber.api.Scenario;
import cucumber.api.java.After;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
public class Googlesearch {
public WebDriver driver = new FirefoxDriver();
@Given("^Google page \"([^\"]*)\"$")
public void i_open_google_page_as(String URL) throws Throwable {
driver.get(URL);
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
}
@When("^I enter \"([^\"]*)\" in search box$")
public void i_enter_in_search_box(String arg1) throws Throwable {
driver.findElement(By.name("q")).sendKeys(arg1);
}
@When("^I press enter key$")
public void i_press_enter_key() throws Throwable {
driver.findElement(By.name("q")).submit();
}
@Then("^I should get the results of \"([^\"]*)\"$")
public void i_should_see_results_of(String content) throws Throwable {
Thread.sleep(3000L);
boolean b = driver.getPageSource().contains(content);
Assert.assertTrue(b);
}
@After
public void after(Scenario scenario) {
driver.close();
}
}
7| Create a new source folder, "resources" under src/test/
8| Now, create a package, "BDD.Cucumber"
9| Then create a file with extension .feature
Right click BDD.Cucumber under src/test/resources > New > Other > File
10| Name the file with extension .feature; i.e., test.feature
@foo
Scenario: google search
Given Google page "http://www.google.com"
When I enter "Prashanth Sams" in search box
When I press enter key
Then I should get the results of "Prashanth Sams"
11| Right click on the project > Run As > maven clean
12| Again Right click on the project > Run As > maven install
Note: For more info. download my sample project from Github Link
It was very nice article and it is very useful to Selenium learners.We also provide Cub training software online training.
ReplyDeleteThanks for sharing this Information, Got to learn new things from your Blog on SELENIUM.
ReplyDeleteRef link : . http://thecreatingexperts.com/software-testing-training-in-chennai/selenium-training-in- chennai/
Thank You for this useful information and Awesome way to present your thoughts and knowledge.
ReplyDeleteI am a beginner and I want to learn more .Keep sharing your knowledge with us.
Selenium Interview Questions
Selenium Tutorial
Selenium Training in Noida
Thanks for sharing this information. It was very nice blog to learn about SAP FICO.
ReplyDeletehttp://thecreatingexperts.com/sap-fico-training-in-chennai/
Can you please extend this with 2 pages? After clicking on any link it will move to next page and verify some functionlity on 2nd page.
ReplyDeleteThanks for the great information in your blog Selenium Training in Chennai
ReplyDeleteThanks for sharing such a great information with us. If you are looking for Ruby on Rails experts in India then email us at: info@cryptextechnologies.com
ReplyDeleteGet a 100% placement opportunity with course more details…….
ReplyDeleteSelenium Training in Chennai
Dot Net Training in Chennai
Dot Net Training in Chennai
Amazing, thanks a lot my friend, I was also siting like a your banner image when I was thrown into Selenium.When I started learning then I understood it has got really cool stuff.
ReplyDeleteI can vouch webdriver has proved the best feature in Selenium framework.
Thanks a lot for taking a time to share a wonderful article.
Some of mine: Top5 Selenium WebDriver Coding Tips | Selenium FAQs
It was a great post. I really appreciate your knowledge that you have shared with. Thank you so much for sharing this blog.
ReplyDeleteSelenium Automation Testing | Selenium with Core Java
ReplyDeleteThose guidelines additionally worked to become a good way to recognize that other people online have the identical fervor like mine to grasp great deal more around this condition.
python Training in Bangalore | python Training in Bangalore
Thank you for taking the time to provide us with your valuable information. We strive to provide our candidates with excellent care.As always, we appreciate you confidence and trust in us.
ReplyDeleteselenium online training
selenium with python training
iframes in selenium
selenium interview questions
selenium certification
Wow this is really amazing post. Thanks for sharing the useful informative data. I appreciate your difficulty work. Keep blogging. Protractor Training in Electronic City
ReplyDeletesupreme
ReplyDeletejordan 11
kobe byrant shoes
supreme clothing
kyrie 7 shoes
supreme hoodie
yeezy boost 350 v2
supreme clothing
kobe byrant shoes
cheap jordans
Openly it's a perfect content, thank you for sharing this,
ReplyDeleteBDD with Cucumber framework
Cucumber framework with BDD
Yapcepcon_fuAlbuquerque Bianca Gutierrez https://wakelet.com/wake/KNoTjyRy4EiVO_FAkT0Sw
ReplyDeleteanabolri
I am really really impressed with your writing skills as well as with the layout on your blog.
ReplyDeleteuok bcom 2nd year result 2021-22 roll number wise
taladiue Leslie Holloway FL Studio
ReplyDeleteAny Video Converter
Internet Download Manager
afininhar
supptegur_mo Diana Brown programs
ReplyDeleteAwesome
cobbblacdanre
hermes bags sale
ReplyDeletejordans
fear of god
Cucumber BDD framework with Selenium is a great read for anyone working with test automation! Implementing Cucumber for behavior-driven development (BDD) not only improves communication between technical and non-technical teams but also makes test scripts more understandable. For those in digital marketing, this approach can be applied to streamline testing on digital platforms, especially when optimizing user experiences. If you’re interested in learning how these testing frameworks play into broader digital marketing strategies, check out our Digital Marketing Course In Delhi By Digiperform
ReplyDelete—it covers all aspects, from SEO to advanced testing techniques.
Thank You for this useful information and Awesome way to present your thoughts and knowledge.
ReplyDeleteI am a beginner and I want to learn more .Keep sharing your knowledge with us.
digital marketing courses in delhi
Thank You for this useful information and Awesome way to present your thoughts and knowledge.
ReplyDeleteMedical Coding Courses in Bangalore
"🚀 Cucumber BDD Framework with Selenium WebDriver
ReplyDeleteThis step-by-step guide walks you through setting up a Cucumber BDD framework integrated with Selenium WebDriver using Java and Maven in Eclipse. The blog highlights key sections with text in blue [#PYTHON] and orange [#JAVA], ensuring important parts stand out. All examples and implementations have been practically done by me for hands-on insights.
While working on this automation framework, I’m also exploring data Science courses in Delhi to enhance my skills in data-driven testing and analytics, which complements automation frameworks like Cucumber for smarter validation.
From adding the Cucumber Eclipse plugin, setting up Maven dependencies, and writing feature files to running test cases with JUnit, this guide ensures a smooth BDD implementation journey. Happy coding and keep exploring new tech intersections! 💻✨"
This is an excellent step-by-step guide on setting up the Cucumber BDD framework with Selenium WebDriver. The detailed instructions for configuring the Maven project and integrating Selenium with Cucumber are super helpful, especially for those working with automated testing frameworks.
ReplyDeleteFor readers interested in expanding their skills further, exploring data Science courses in Delhi could be a great complement. These courses often cover Python programming, data analysis, and machine learning, which can enhance your testing automation capabilities and provide deeper insights into data-driven testing.
Looking forward to checking out your sample project on GitHub. Keep sharing such practical tutorials! 🚀
good posts
ReplyDeleteMedical Coding Courses in Kochi
This guide provides a step-by-step approach to setting up the Cucumber BDD Framework with Selenium WebDriver using Maven in Eclipse. It includes details on installing the required Cucumber Eclipse plugin, configuring the POM.xml file, and adding necessary dependencies to ensure smooth integration for test automation.
ReplyDeleteFor those looking to enhance their career prospects, exploring Medical Coding Courses in Delhi could be a great opportunity to enter the growing healthcare industry with in-demand skills.
Happy coding and testing! 🚀
If you want to create robust, browser-based regression automation suites and tests, scale and distribute scripts across many environments, then you want to use Selenium WebDriver, a collection of language specific bindings to drive a browser - the way it is meant to be driven.
ReplyDeleteMedical Coding Course in Hyderabad
enjoyed reading the article
ReplyDeleteMedical Coding Course in Hyderabad
Fantastic explanation of integrating Cucumber BDD with Selenium! This guide is super helpful for anyone getting started with test automation frameworks.
ReplyDeleteMedical Coding Courses in Delhi
Coimbatore is a popular state of Tamil Nadu. The people of Coimbatore have an entrepreneurial mindset. The people are mainly from the Tamil community with a significant number of Telegus. Nowadays technology is emerging rapidly. Medical coding is also becoming an emerging technology to make it standardized. Medical coding courses in Coimbatore provide career growth and several opportunities for students to grow more. In Coimbatore, many medical coding institutes are offering technology-based medical coding courses for students and professionals who want to build their careers in this field.
ReplyDeletehttps://iimskills.com/medical-coding-courses-in-coimbatore/
Thanks for sharing, Pushpa! This is the Cucumber BDD framework with Selenium WebDriver in Eclipse using Maven. It covers installing the Cucumber Eclipse plugin, adding Maven dependencies, and configuring the project.
ReplyDeleteMedical Coding Courses in Chennai
If you want to create robust, browser-based regression automation suites and tests, scale and distribute scripts across many environments, then you want to use Selenium WebDriver, a collection of language specific bindings to drive a browser - the way it is meant to be driven.
ReplyDeletedata Science courses in Delhi
"IIM SKILLS offers such an amazing learning experience. The blend of theory and practical knowledge is unmatched."
ReplyDeletehttps://iimskills.com/data-science-courses-in-india/
The instructors are true experts in their field. They know how to make complex concepts easy to understand.
ReplyDeleteIt’s great how they teach with case studies from different industries.
ReplyDeleteData Science Courses in India
Such a thoughtful and engaging piece! I appreciate how you break down ideas in a reader-friendly way. For readers thinking of entering the medical field, the Medical Coding Course by IIM SKILLS in Varanasi is a smart and career-focused choice.
ReplyDeleteMedical Coding Courses in Varanasi
We used tools like Canva, SEMrush, Ahrefs — incredibly useful.
ReplyDeleteNice and informative article.Medical Coding Courses in Delhi
ReplyDeleteThanks for sharing such a well-explained post—it's both insightful and easy to follow. Clear content like this truly adds value for readers.
ReplyDeleteIf anyone’s exploring career options, Medical Coding is a great field to consider. Delhi offers excellent Medical Coding Courses with job-oriented training.
Medical Coding Courses in Delhi
It looks like you're setting up the Cucumber BDD framework with Selenium WebDriver!
ReplyDeleteMedical Coding Courses in Norway
Very informative and well-structured guide for setting up Cucumber with Selenium! This walkthrough is super helpful for beginners getting started with BDD testing. Thanks for sharing!
ReplyDeleteMedical Coding Courses in Kochi
This blog post on using the Cucumber BDD framework with Selenium WebDriver provides a clear and practical introduction to behavior-driven development (BDD) in test automation. Combining Cucumber’s readable Gherkin syntax with Selenium’s powerful browser automation creates a robust testing approach that bridges the gap between technical teams and business stakeholders.
ReplyDeleteThe explanation of how Cucumber facilitates collaboration by writing test scenarios in plain English is especially helpful. This makes it easier for non-technical team members, such as product owners and QA analysts, to understand and contribute to the test design. Integrating these scenarios with Selenium WebDriver means the tests are not just documentation—they become living tests that validate application behavior automatically.
The post does well to walk through setting up the environment, defining feature files, step definitions, and linking these with Selenium actions. For anyone new to BDD or Selenium, this structure helps demystify how everything fits together.
Medical Coding Courses in Coimbatore
This is a fantastic post that clearly explains how to integrate the Cucumber BDD framework with Selenium. I really liked the step-by-step breakdown, which makes it easier for beginners to follow and implement. The use of practical examples adds a lot of clarity to the concept. It’s evident that you’ve put in effort to simplify a complex topic. Thanks for sharing such a valuable and well-structured tutorial!
ReplyDeleteMedical Coding Courses in Mumbai
If you want to create robust, browser-based regression automation suites and tests, scale and distribute scripts across many environments, then you want to use Selenium WebDriver, a collection of language specific bindings to drive a browser - the way it is meant to be driven.
ReplyDeleteMedical Coding Courses in Mumbai
I appreciate how clearly you laid out the project structure, from feature files to step definitions and page objects. Seeing the real code examples makes it much easier to grasp how everything fits together. This is a solid hands-on resource for anyone looking to build readable, maintainable test suites.
ReplyDeleteMedical Coding Courses in Mumbai
This guide on implementing a Cucumber BDD framework with Selenium is excellent—well-structured and practical for test automation professionals. The step-by-step approach makes setup and execution clear and efficient. If you're also exploring rewarding career options beyond tech, consider checking out Medical Coding Courses in Norway for outstanding healthcare training and job opportunities.
ReplyDeleteThis is a super helpful and detailed walkthrough for setting up a basic Cucumber BDD framework with Selenium in Eclipse! It’s great for beginners who want a clear step-by-step guide with actual code examples. Medical Coding Courses in Mumbai
ReplyDeleteFantastic explanation of how Cucumber ties into BDD with Selenium.
ReplyDeleteMedical Coding Courses in Mumbai
Thank you for guiding the setup of the Cucumber BDD framework with Selenium through easy and clear steps.
ReplyDeleteMedical Coding Courses in Mumbai