开发者

Null pointer exception in selenium RC Using java

I wrote two Methods Fil开发者_开发问答e 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?


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜