Jump to content
Fórum Script Brasil
  • 0

java.lang.NullPointerException WebDriver



Boa noite, criei 2 classes

1ª classe


import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class Seila {
    public WebDriver navegador(){
        String url ="https://www.google.com.br";
        WebDriver driver = new FirefoxDriver();
        return driver;


2ª classe

public class Teste2 {
    Seila s;
    public void asd(){
        WebElement c = s.navegador().findElement(By.id("gs_htif0"));
    public static void main(String [] asd){
        Teste2 t = new Teste2();



Exception in thread "main" java.lang.NullPointerException
    at teste.Teste2.asd(Teste2.java:10)
    at teste.Teste2.main(Teste2.java:16)

Alguém pode me ajuda?


Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Forum Statistics

    • Total Topics
    • Total Posts
  • Create New...