Selenium Cucumber

  • /
  • Courses

Duration

20 Hours

Course Price

$ 399.00

4.5 (23)

Overview

Course Content

 

1) SetUps

  • Java Jdk and build path
  • Eclipse

2) Basics Of Java

  • Java Introduction
  • DataTypes
  • Looping Concepts
  • Conditional Statement
  • Concatenation Operator
  • Local & Global Variable
  • Static Variable
  • Object
  • Static & Non Static Concepts
  • Object Reference
  • Pass by Value
  • Pass by Reference
  • Constructor
  • Overloading
  • This Keyword
  • What is Class?
  • Polymorphism
  • Inheritance
  • Overriding
  • Final Class
  • Final Variable
  • Final Method
  • Interface
  • Abstraction
  • Encapsulation
  • ArrayList
  • HashTable
  • Collections
  • Convert DataTypes
  • String To Integer
  • Integer to String

3) Selenium WebDriver

  • Why WebDriver?   
  • Downloading and configuring webdriver in eclipse  
  • WebDriver Interface  
  • Drivers for Firefox, IE, chrome, etc
  • First Selenium WebDriver Code  
  • Opening multiple browsers at one time
  • Close and Quit methods in Webdriver
  • HTML language tags  
  • Handling Links with WebDriver
  • Extracting Xpaths and relevance of Xpaths  
  • Identifying Web Elements using id, name, linkname, class, xpath, tagname etc  
  • Handling Input Box/Buttons  
  • Handling Web List
  • Handling Radio Buttons, CheckBoxes
  • Extracting links and other web elements  
  • Capturing screenshots with WebDriver  
  • Window handles  
  • Tabbed browsing with Selenium 
  • Example of Tabbed browsing
  • Pop up handling in Selenium  
  • Example of Pop up handling  
  • Pausing execution for sometime  
  • Introducing wait for sometime  
  • WebDriverWait Class
  • Extracting Data From Web Table  
  • Dynamic Web Table Handling
  • Attaching files with Selenium  
  • Mouse movement with Selenium- Mouse Interface  
  • Working with Calendar using Selenium  
  • Simulating front and back button click on Browser using selenium  
  • Maven integration with eclipse
  • What is Maven
  • What is POM

4) Read/Write Data

  • Read/ Write data in Text File
  • Read/Write data in Excel
  • Read Data from Property File

5. Basics Of Cucumber

  • Behaviour-Driven Testing
  • Introdiction to Cucumber
  • What is BDD?
  • BDD v/s TDD
  • What is Cucumber

6. More Adnaved Concepts to Cucumber

  • Introduction to Gherkin
  • Selenium Integration with Cucumber BDD
  • Maven project setup for Cucumber with Selenium
  • Writing Feature Files with Gherkin Syntax
  • Running Scenarios from Feature File Cucumber Annotations
  • Working with Step Definitions Data Driven Testing in Cucumber
  • Parameterization of Test Cases Passing Data Tables to Steps Integrating
  • Cucumber scenarios with Junit tests
  • Adding Scenario tags
  • Scenario Hooks in Cucumber Generating Reports

7. Testing using JUnit

  • Configure Junit Project
  • JUnit Annotations
  • Parameterization in JUnit
  • Error Collector
  • Assertions
  • Exception Handling
  • Batch Execution
  • ANT Configuration

8. Testing using TestNG

  • Configure TestNG Project
  • TestNGAnnotations
  • Parameterization in TestNG
  • Run Test in Batch
  • XSLT Report Generation

9. Automation Scripts Creation –Live Project

 

 

Trainer Profile

Interview Questions & Answer

 

1) What is Cucumber?

Cucumber is a tool which is based on Behavior Driven Development (BDD) methodology.The main aim of the Behavior Driven Development framework is to make various project roles such as Business Analysts, Quality Assurance, Developers, etc., understand the application without diving deep into the technical aspects.

 

2) What language is used by Cucumber?

 Gherkin is the language that is used by the Cucumber tool. It is a simple English representation of the application behavior. Gherkin language uses several keywords to describe the behavior of applications such as Feature, Scenario, Scenario Outline, Given, When, Then, etc.

 

3) What programming language is used by Cucumber?

Cucumber tool provides support for multiple programming languages such as Java, .Net, Ruby etc. Cucumer can also be integrated with multiple tools such as Capybara, selenium etc.

 

4) Which symbol is used for parameterization in Cucumber?

Pipe symbol (|) is used to specify one or more parameter values in a feature file.

 

5) Give an example of a step definition file in Cucumber.

Step definition corresponding to the step “Open Chrome browser and launch the application” may look like the code mentioned below:

@Given("^Open Chrome browser and launch the application$")

public void openBrowser()
 
{
driver = new ChromeDriver();
driver.manage().window().maximize();
driver.get("www.facebook.com");
}

6) Give an example of a Scenario Outline using the Cucumber framework.

 The following is an example of a Scenario Outline keyword for the scenario ‘Upload a file’. The number of parameter values to be included in the feature file is based on the tester’s choice.

 

Scenario Outline: Upload a file

Given that the user is on upload file screen.
When a user clicks on the Browse button.
And user enters onto the upload textbox.
And user clicks on the enter button.
Then verify that the file upload is successful.

Examples:

|filename|
|file1|
|file2|

 

7) What is the purpose of the Cucumber Options tag?

Cucumber option tag  is used to provide a link between the feature files and step definition files. Every step of the feature file is mapped to a corresponding method on the step definition file.

Below is the syntax of Cucumber Options tag:

@CucumberOptions(features="Features",glue={"StepDefinition"})

 

8) What is the name of the plugin that is used to integrate Eclipse with Cucumber?

The plugin that is used to integrate Eclipse with Cucumber is Cucumber Natural Plugin.

 

9) Give an example of TestRunner class in Cucumber.

Package com.sample.TestRunner
 
 
importorg.junit.runner.RunWith; 
importcucumber.api.CucumberOptions; 
importcucumber.api.junit.Cucumber;
 
@RunWith(Cucumber.class) 
@CucumberOptions(features="Features",glue={"StepDefinition"}) 
public class Runner 
{
}

 

10) Why we should  use Cucumber with Selenium?

Cucumber and Selenium, these are two popular technologies. Many organizations use Selenium for functional testing. The organizations which are using Selenium want to integrate Cucumber with Selenium as Cucumber helps you to read and to understand the application flow.

 

11) Name some reporting tools to be used with cucumber?

 We can use report tools like Jenkins or bamboo tool.

 

12) What software do you need to run cucumber in JAVA?

The softwares required to run cucumber in JAVA are:

  • Eclipse or IntelliJ IDE
  • Gradle or Maven build tool
  • Junit or TestNG testing framework
  • Cucumber
  • Selenium (To automate browser)

 

Blog

 

Selenium and Cucumber are a great combination when it comes to web application automation. As Cucumber allows you to write your tests quickly in English-like language and Selenium allows you to run on various combinations of browsers. Let us take a look on some details on how we can put them together.

 

Basic

Web application regression testing is done to assess the app compatibility across a range of browsers, but this method is a burden on both time and money. A better method would be the use of multiple test suites to be driven across a number of browsers.

The benefit of this approach is that errors and glitches get identified early in the production pipeline, and can be resolved almost immediately.

When using Selenium with Cucumber for test automation, tests are written in feature files that can be understood by various stakeholders in an agile environment such as the BA’s. Cucumber also comes with its ability to support multiple scripts and programming languages, the Selenium API is one that allows to drive the browser.

 

An overview of the process

Cucumber essentially acts as a common ground between developers and non-technical stakeholders.

The BDD style is used in writing tests, which is easily comprehensible and doesn’t require any deep knowledge of code (basic commands i.e., Given, When, Then).

After the acceptance tests are written into feature files, Cucumber picks the feature steps and executes the step definitions defined in the respective programming language.

The Selenium WebDriver API can be called in these step definitions to drive the browsers.

Some More details

 

Cucumber does not communicate directly with the applications, it needs to be used in conjunction with tools such as Selenium WebDriver. Cucumber acts more like an execution framework. Cucumber’s use of English-like language (Gherkin) for its programming function, test case execution is supported with features and scenarios executed based on their definitions.

 

There are 3 steps for writing automated tests that deliver high value while requiring only low maintenance using Cucumber:

 

  1. Define scenarios
  2. Create step definitions
  3. Define UI Element descriptions

 

Concluding Words

We’ve described the working relationship between selenium and Cucumber here, but there are of course a number of BDD tools that can be used together for the purpose of building test automation suites that deliver high value to your business and do not require heavy maintenance.

 

Register For Online Demo


Can't read the image? click here to refresh