Showing posts with label Eclipse. Show all posts
Showing posts with label Eclipse. Show all posts

Saturday, March 10, 2018

Java for Selenium - Mindmap Object, Classes and Inheritance

In the above example. We create a class bicycle which is defined by it's state and behavior.
members and methods are defined in the class. We can defined multiple objects of the class using class methods and members. 

Bicycle itself belongs to two wheeler class. Similarly there can be other class for motor bike which can have its own member and methods defined. 

Both bicycle and two wheeler can have specific methods and members defined in the class. 

Bicycle extends two wheeler which in turn extends vehicle, bicycle can use members and methods defined in two wheeler as well as vehicle class.

Class Declaration

class Bicycle extends TwoWheeler {
    // field, method and constructordeclarations
}

class TwoWheeler extends Vehicle {
    // field, method and constructordeclarations
}


Variables in a class:

Fields - Member variables in class
Local variable - defined inside method or block of scope
Parameters - variables in method declaration

Variable declaration : [Modifier] Type variablename

Saturday, June 17, 2017

How to execute only failed TestNG tests in Eclipse

While running testNG suite, once we are done with one round of execution of tests in the test suite, It can be helpful to execute only the failed tests during the first round of execution to reduce test failures due to flakiness/synchronization issues.

Below steps shows how to achieve this in eclipse.

  • Run the required test suite through eclipse as shown below.
testng eclipse run
  • Once the execution is completed and there are failures in the execution, we may require to rerun the tests.
  • Refresh the project. folder test-output should be displayed in the project explorer.
  • File testng-failed.xml should be available in the folder.
  • Run the test suite in similar manner as shown above, i.e Run As TestNG suite.

Saturday, September 24, 2016

Importing an existing maven Project in eclipse in three steps.

An existing Maven Project can be imported in eclipse following simple steps as shown below.


1. In the eclipse workspace, click on File>Import.



 2. Select Maven>Existing Maven Projects

3. Browse to the folder location when Maven Project to be imported exist. Once the location is provided. It will search for the POM file. Select the file and click on Finish. Maven Project will be imported successfully.It will take a while to download dependencies and available to use.