How to use JMeter for login authentication?

How to use JMeter for login authentication?

Regular Expression Extractor is used to handle this situation. Following steps may be used,

  1. First find out the GET request where the authentication required & POST request that posts the credential to login
  2. The response from the GET request should have tokens which needs to be be extracted and sent as a parameter in the POST request.
  3. Add a Regular Expression Extractor to store these tokens and include the tokens as parameter in the POST request

What is polymorphism in java with example

What is polymorphism in java with example

polymorphism means one object can take multiple forms. lets explain this using a method poly() in java class.

steps:

  1. create a package polymorphismPkg in eclipse
  2. create a class polymorphismClass  in eclipse
  3. now write below code in the class polymorphismClass  

package polymorphismPkg;

public class polymorphismClass {

public static void main(String[] args) {

polymorphismClass obj1 = new polymorphismClass();

obj1.poly(1, 2);
obj1.poly(1, 2, 3);
obj1.poly(1, 22.11);

}

public static void poly(int a, int b)

{
System.out.println(“this is first method for polymorphism”);
}

public static void poly(int n, int b, int c)

{
System.out.println(“this is like first method but number of argument is different in signature “);

}

public static void poly(int n, double b)

{
System.out.println(“this is like first method but argument order is different in the signature “);

}

}