Different web drivers invoking using selenium java

The ways to invoke different web drivers in selenium are as follows. For Chrome Driver use the following syntax. This is the driver path- “/Users/………/chromedriver” For gecko driver (Firefox driver) use the following one. For the Microsoft edge driver use the following . Links to download different drivers. Chrome Driver- https://chromedriver.chromium.org/downloads Firefox Driver- https://github.com/mozilla/geckodriver/releases Edge…

Static and instance variables in java

Static variable: Static variables are declared using the keyword static.Every instances of the particular class shares the same static variable , that means if the changes are made to the static variable, then all the instances of that class will get affected. In the following example ‘color’ is a static variable within the class Ball.We…

Static and instance method in java

Static methods are declared using static modifier.Static method can’t access instance method and instance variables directly.In static method we should not use ‘this’ keyword.Static method does not need an instance to be created .It can directly be called as ClassName.Methodname(parameter) To use the instance method we need to create specific instance of the class. public…

Method Overloading and Method Overriding

Method Overloading: Method overloading means there are multiple methods, within a class, with same name but with different parameters.Method return types may or may not be same.Method overloading may happen inside a class or inside a subclass. public class Main {public static void main(String[] args) {Animal a =new Animal();a.Horse();a.Horse(“black”);a.Horse(10);}}class Animal {private String color; public void…

this() and super() call in java

this( ) call : In java ‘this()’ is used to call a constructor from another overloaded constructor in the same class. It should be the first statement within the constructor. public class Car {public static void main(String[] args) {Toyota obj1=new Toyota(6,16);Toyota obj2=new Toyota();System.out.println(obj1.getvalues()); // output 6System.out.println(obj2.getvalues()); //output 0}} class Toyota{private int height;private int width;private int…