1

I wrote two Methods File name Login.java:

public int multiply(int x, int y) {
    return x * y;
}

public void news(){
    selenium.open("http://10.0.0.33:8080/Olio/");           
}

I call these from a different class named Bank.java

public void testBank() throws Exception {
    Login lg = new Login(); 
    System.out.println(lg.multiply(4,8));
    lg.news();
    Thread.sleep(3000);             
}

The first method works, I get 32. The second method throws a java.lang.NullPointerExpression.

Why is this happening?

1 Answer 1

3

I am guessing that selenium is null. Have you instantiated it anywhere ?

Sign up to request clarification or add additional context in comments.

1 Comment

he has defined the selenium in bank.java. what is the process now... I also needed the answer for same issue ...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.