Execute Specific Group of Test Cases in TestNG

Debomita Bhattacharjee
Updated on 11-Jun-2020 12:41:02

1K+ Views

We can run a particular set of test cases by including a group of test cases in the execution.ExampleTestng xml files with groups.                                                                           To run a group of test cases from the set of test cases, we have to define in the testng xml file. Here the testNG xml contains group Smoke to be included in execution.Example@Test(groups={"Smoke"}) public void Payment(){    System.out.println(“Payment is successful”); }In the Java class file only the test method with group as Smoke will be run out of the entire regression suite.

Overlook a Particular Test Method in TestNG

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

463 Views

To overlook a particular test method from execution in TestNG enabled helper attribute is used. This attribute has to be set to false to overlook a test method from execution.ExampleJava class file.@Test(enabled=false) public void verifyRepay(){    System.out.println("Repayment successful"); } @Test public void Login(){    System.out.println("Login is successful "); } @Test public verifyHistory(){    System.out.println ("History verification is successful"); }Here the verifyRepay() method shall be overlooked during execution.

TestNG Test Method Execution Dependencies

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

383 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.

Purpose of the TestNG XML File

Debomita Bhattacharjee
Updated on 11-Jun-2020 12:25:18

2K+ Views

The testng.xml file has the numerous uses as listed below −Test cases are executed in groups.Test methods can be included or excluded in the execution.The execution of multiple test cases from multiple java class files can be triggered.Comprises names of the folder, class, method.Capable of triggering parallel execution.Test methods belonging to groups can be included or excluded in the execution.ExampleTestNG.xml file                                                         Here as per the xml file, ... Read More

Explain Modular Automation Framework

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

3K+ Views

In a modular automation framework, test scripts are developed on the basis of modules or clusters by dividing the entire application into several small and self-sufficient blocks. Thus individual test scripts belonging to a particular module or cluster are created.These scripts belonging to these isolated modules can be integrated and can be driven by a master driver script to perform integration testing among the modules. All these are achieved with the help of common function libraries (containing essential methods and procedures) which are used while developing scripts for the modules.Modular automation framework follows the concept of Abstraction. Here in this ... Read More

Image Smoother in C++

Arnab Chakraborty
Updated on 11-Jun-2020 12:21:54

435 Views

Suppose we have a 2D matrix M representing the gray scale of an image, we have to design a smoother to make the gray scale of each pixel becomes the average gray scale (rounding down) of all the 8 surrounding pixels and itself. If a cell has less than 8 surrounding cells, convert all possible pixels.So, if the input is like111101111then the output will be000000000To solve this, we will follow these steps −R := row count of MC := column count ofDefine an array d = { -1, 0, 1 }Define one 2D array res of size (R x C)for ... Read More

Differences Between TDD and BDD

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

1K+ 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

Test Driven Development Framework Explained

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

337 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

Explain Behavior Driven Framework

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

357 Views

Behavior driven framework takes the inputs from all the stakeholders in the project like the developers, testers, product owners, managers, customers and business analysts. The idea is to bring each of the members of the project in the same understanding.Behavior driven framework works on collaboration and coordination among everyone in the team. Technical coding knowledge is not necessary since the functional requirements or specifications are described in non – technical, common language.This specification can be used as a standard template for the testers while designing the test cases by both automation and manual testers. Test coverage for each business scenario ... Read More

Robot Return to Origin in C++

Arnab Chakraborty
Updated on 11-Jun-2020 12:18:04

377 Views

Suppose there is a robot and its starting position is (0, 0). If we have a sequence of its movements, we have to check whether this robot ends up at (0, 0) after it completes its moves.The move sequence is given as a string, and the character moves[i] represents its ith move. Symbols are R for right, L for left, U for up, and D for down. If the robot returns to the origin after it finishes all of its moves, return true. Otherwise, return false.So, if the input is like "RRULLD", then the output will be true, Right two-unit, ... Read More

Advertisements