Found 455 Articles for Software Testing

What do you mean by Scenario Outline in Cucumber?

Debomita Bhattacharjee
Updated on 11-Jun-2020 13:06:11

417 Views

We use the Scenario Outline keyword in the feature file in Cucumber. If a particular scenario needs to be executed with more than a set of data in multiple combinations, then we use the Scenario Outline.The multiple data sets are represented in form of a table separated by (||) symbol under Examples keyword. Each row represents a group of data.ExampleFeature file.Feature: Login Verification Feature Scenario Outline: Login Verification Given User lands on the home page When Page title is Tutorialspoint Then User keys in "" and "" Examples: | username | password | | Selenium | t123 ... Read More

What are the main file components in Cucumber?

Debomita Bhattacharjee
Updated on 11-Jun-2020 13:04:56

702 Views

The main file components in Cucumber are listed below −Feature file − This file has an extension of .feature. It comprises single or multiple test scenarios in plain text. All the scenarios are written with the keywords like Then, Given, When, And, But, Feature, Background and so on.ExampleFeature file.Feature: Login Test Scenario: Tutorialspoint login validation Given: Launch the “https://www.tutorialspoint.com/index.htm”Step Definition File - This file has an extension of .java. It provides mapping of the test scenarios to the test script logic.ExampleStep Definition file based on the above feature file.@Given (“^Launch the \"([^\"]*)\"$”) public void launch_application(String url){    System.out.println("The url is ... Read More

What are the advantages of using Cucumber?

Debomita Bhattacharjee
Updated on 11-Jun-2020 13:01:11

2K+ Views

Some of the advantages of using Cucumber are listed below −Cucumber is an open source tool and does not require licensing.Cucumber can be easily configured with IDEs like Eclipse.Cucumber bridges the understanding and communication gaps among developers, testers, business analysts, customers and product owners.Cucumber enables the participation of business stakeholders who do not have technical knowhow.Cucumber gives plain text representation which enables easy understanding for non-technical members in the team.Cucumber is easy to maintain and is scalable.Cucumber increases the reusability of important steps.Cucumber promotes teamwork since each individual in the team can contribute.Cucumber uses the Gherkin tool which is simple ... Read More

How does the execution of a particular test method depend on other testmethods in TestNG?

Debomita Bhattacharjee
Updated on 11-Jun-2020 12:29:24

235 Views

The execution of a particular test method can be made dependent on another test method with the help of dependsOnMethods helper attribute.Example@Test(dependsOnMethods={"Payment"}) public void verifyLoan(){    System.out.println("Loan payment successful"); } @Test public void Payment(){    System.out.println("Payment successful "); } @Test public verifyTransaction(){    System.out.println ("Transaction verification"); }Here in the Java class file, verifyLoan() method will only be executed after the Payment() method is run successfully. But verifyTransaction() method runs independently without having a precondition test method to be executed.

State the differences between TDD and BDD.

Debomita Bhattacharjee
Updated on 11-Jun-2020 12:21:31

919 Views

The differences between Test Driven Development (TDD) and Behavior Driven Framework (BDD) are listed below −Sl No.TDDBDD1This is driven by the developers.This is driven by developers, QAs, product owners, customers and business analysts.2This is mostly focused on the coding implementation of the functionalities of the application.This is mostly focused on the business scenarios of the product.3This is mainly used for unit testing.This is mainly for making developers, testers, product owners, customers and business analysts agree on functional requirements of the application.4The popularly used tools are JDave, SpecFlow and so on.The popularly used tools are Cucumber, Gherkin, BeanSpec and so on.5TDD ... Read More

Explain Test Driven Development Framework.

Debomita Bhattacharjee
Updated on 11-Jun-2020 12:19:52

219 Views

Test Driven Development framework is the methodology implemented from a developer’s mindset. Here, a developer writes test cases covering each and every functionalities of the application with the intention of verifying if the code is proper.Once these test cases get failed, the developers’ refactor the code in order to make those test cases pass. The process continues till all test cases get passed. This type of approach is extensively used in agile methodology. In this framework, test scripts are ready before the actual functionalities of the product are developed.The most difficult thing in TDD is to design test scripts even ... Read More

How to verify the color and background color of a web element in Selenium?

Debomita Bhattacharjee
Updated on 11-Jun-2020 12:12:43

10K+ Views

We can verify the color and background color of a web element in Selenium with the help of getCSSValue() method.Exampleimport org.openqa.selenium.By; import org.openqa.selenium.Keys; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import java.util.concurrent.TimeUnit; public class CssColorValue {    public static void main(String[] args) { System.setProperty("webdriver.chrome.driver", "C:\Users\ghs6kor\Desktop\Java\chromedriver.exe");       WebDriver driver = new ChromeDriver();       String url = "https://www.tutorialspoint.com/index.htm";       driver.get(url);       driver.manage().window().maximize();       driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);       //getting color attribute with getCssValue()       String colr = driver.findElement(By.xpath("//*[text()=’GATE Exams’]")) ... Read More

List down the differences between Selenium and UTP.

Debomita Bhattacharjee
Updated on 11-Jun-2020 12:09:22

112 Views

The differences between Selenium and UTP are listed down below.sl.no.SeleniumUTP1It is open source and can be used free.It is a licensed tool and is commercialized for use.2It supports the majority of browsers like Chrome, Firefox, Internet Explorer, Safari and so on.It supports Chrome, Firefox and Internet Explorer.3It only tests web based applications.It tests both windows and web based applications.4There is no in built object Repository.By default, object repositories are available and maintained.5It can be developed on multiple languages like Java, C#, Javascript, Python and so on.It can be developed only on VB scripts.6There is no external support for vendors for ... Read More

How to verify if an element is displayed on screen in Selenium?

Debomita Bhattacharjee
Updated on 11-Jun-2020 12:07:49

9K+ Views

We can verify the visibility of web elements like edit box, checkbox, radio buttons and so on with the help of method listed bels −isDisplayed()This method checks if a webelement is present on the screen.Syntax −Boolean result = driver.findElement(By.xpath("//span[text()=’Coding Ground’]")).isDispayed();isSelected()This method checks the status of the radio button, check box and options in the static dropdown.Syntax −Boolean btnresult = driver.findElement(By.xpath("//xpath[contains(@class, ’gsc-search-button’)]")).isSelected();isEnabled()Syntax −Boolean btnresult = driver.findElement(By.xpath("//xpath[contains(@class, ’gsc-search-button’)]")).isEnabled();This method if an element is enabled or not.Exampleimport org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import java.util.concurrent.TimeUnit; public class ElementStatus{    public static void main(String[] args) {       System.setProperty("webdriver.chrome.driver",       ... Read More

How to deal with reusable components in Selenium Java?

Debomita Bhattacharjee
Updated on 11-Jun-2020 12:05:37

845 Views

We can deal with reusable components in Selenium Java with the help of inheritance concept. It is a parent child relationship where the child class inherits the properties and methods of the parent class.ExampleFor Parent class.import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.util.Properties; import org.openqa.selenium.WebDriver; import org.openqa.selenium.firefox.FirefoxDriver; public class Baseclass {    public void login() throws IOException {       Properties prop = new Properties();       //Reading values from property file       FileInputStream ips = new FileInputStream(       "C:\Users\ghs6kor\eclipse- workspace\Inheritance\config.properties");       prop.load(ips);       System.setProperty("webdriver.gecko.driver",       ... Read More

Advertisements