Tutorial on the integration of Selenium with cucumber for experts and fresher’s - PowerPoint PPT Presentation

About This Presentation
Title:

Tutorial on the integration of Selenium with cucumber for experts and fresher’s

Description:

Before starting the work with selenium or cucumber we know that what is actually selenium and cucumber. Here in this PPT, I will share the Best tutorial about Selenium and cucumber. For more information please visit here. – PowerPoint PPT presentation

Number of Views:1419

less

Transcript and Presenter's Notes

Title: Tutorial on the integration of Selenium with cucumber for experts and fresher’s


1
Original Source Tutorial on Selenium, Cucumber
and Gherkin
2
What is SELENIUM
In recent times, there are a lot of applications
which are web-based and which run in a browser.
Testing such applications manually take up much
time hence automated testing tools like selenium
is the way to go. Selenium is a free open
source automated testing tool for web
applications across various browsers and
platforms. It is actually similar to HP Quick
Test Pro only that Selenium converges on
automating web-based applications.
3
What is
Many times it happens that clients are
non-technical persons and to make them understand
the testing process you need a behavior driven
framework. Cucumber is a behavior driven
framework which can help you to produce the
product as per client needs. It tests the
behavior of the application and writes the tests
in simple English language which is similar to
English and known as Gherkin language.
4
Prerequisite for using Cucumber with Selenium
  • Selenium jar files
  • Selenium-server-standalone
  • Can be downloaded at 
  • http//www.seleniumhq.org/download/

 
5
Continue
  • Jar files For Cucumber
  • Cucumber-core
  • Cucumber-html
  • cobertura code coverage
  • Cucumber-java
  • Cucumber-junit
  • Cucumber-jvm-deps
  • Cucumber-reporting
  • Hemcrest-core
  • Gherkin
  • Junit
  • Can be downloaded at http//mvnrepository.com/sear
    ch?qCucumber
  • On this page, you have to search files download
    them individually. Lets go through Some
    Screenshot!

6
Continue
7
Continue
8
Continue
9
Automation Testing Using Cucumber with Selenium
First of all, create a JAVA project in eclipse by
New -gt Project -gt Other, here you have to select
Maven in other projects
10
Continue
Now go to Project gt Select Properties gt Java
Build Path and add all the libraries downloaded
earlier
11
Continue
Now create a folder by name "Features" and then
create a new file in it by name MyTest.feature.
You can write Gherkin syntax in it now.
12
Continue
Write below lines in MyTest.feature file using
Gherkin syntax.
Feature Reset functionality on login page of
Application Scenario Verification of Reset
button Given Open the Firefox and launch the
application When Enter the Username and
Password Then Reset the credential
13
Continue
Now write the selenium testrunner script. Here we
create 'TestRunner' package and then
'Runner.java' class file under it.
  • _at_RunWith() is the test runner class to start
    executing test
  • _at_CucmberOptions() is used to set some properties
    for cucumber test like feature file, step
    definition, etc.

14
Continue
Now here we create 'StepDefinition' package and
then 'Steps.java' script file under it.
_at_Given is used to open Firefox and launch the
application _at_When is used to enter the username
and password _at_Then  is used to reset the
credential
15
Continue
Now execute the script and analyze the output.
16
Conclusion
  • Cucumber is a recognized BDD tool and it is very
    simple to write/read and can be read by clients
    either they are a technical and non-technical
    person.
  • Cucumber and Selenium integration can be done
    using the following 3 steps
  • Create a feature file and write tests in Gherkin
    language.
  • Then Create Testrunner file and execute this
    script.
  • Create Step definition, the real selenium script
    described under this package.
  • Original Source
  • Tutorial on Selenium, Cucumber and Gherkin
  • Selenium with Cucumber (BDD Framework) Tutorial
    with Example

17
Contact Us
Web
www.nexsoftsys.com
Call
1-646-971-0799
Email
info_at_nexsoftsys.com
Write a Comment
User Comments (0)
About PowerShow.com