I haven't seen this error message before until I moved to this latest
build. This same error happens on Firefox 14, 15.1, and 16. I'm using
32-bit JDK 1.6_027. Using TestNG 6.3. Using Selenium 2.25.0 .

My code that generates this error is typical and looks something like this:

-------------------------------
final WebElement we = (new WebDriverWait(driver, 10))
.until( new ExpectedCondition<WebElement>() {
@Override
public WebElement apply(WebDriver d) {
return d.findElement( By.className("contentGroupBoxTitle") );
} } );
boxtitle = we.getText();
System.out.println("boxtitle=" + boxtitle + "=");

-------------------------------
I also tried this similar method and got the same result :

Wait<WebDriver> wait = new WebDriverWait(driver, 20);
WebElement we = wait.until( visibilityOfElementLocated(
By.cssSelector("div.contentGroupBoxTitle") ) );
public ExpectedCondition<WebElement> visibilityOfElementLocated(final By
by) {
         return new ExpectedCondition<WebElement>() {
           public WebElement apply(WebDriver driver) {
             WebElement element = driver.findElement(by);
             return element.isDisplayed() ? element : null;
           }
         };
       }
-------------------------------

java.lang.NullPointerException
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:191)
at org.openqa.selenium.support.ui.FluentWait.(WebDriverWait.java:66)
at
org.openqa.selenium.support.ui.WebDriverWait.(MenuPage.java:78)
at
org.openqa.selenium.support.ui.LoadableComponent.get(LoadableComponent.java:45)
at tr.reporting.pages.MenuPage.(BaseTests.java:94)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
at
org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
at org.testng.SuiteRunner.run(SuiteRunner.java:240)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1197)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1122)
at org.testng.TestNG.run(TestNG.java:1030)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to selenium-users@googlegroups.com.
To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/AfKnu4iieuAJ.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Daniel Wagner-Hall at Oct 6, 2012 at 11:04 pm
    This means your WebDriver object is null. It mustn't be.
    On Thursday, 4 October 2012 23:46:37 UTC+1, Jon Thor Austen wrote:

    I haven't seen this error message before until I moved to this latest
    build. This same error happens on Firefox 14, 15.1, and 16. I'm using
    32-bit JDK 1.6_027. Using TestNG 6.3. Using Selenium 2.25.0 .

    My code that generates this error is typical and looks something like this:

    -------------------------------
    final WebElement we = (new WebDriverWait(driver, 10))
    .until( new ExpectedCondition<WebElement>() {
    @Override
    public WebElement apply(WebDriver d) {
    return d.findElement( By.className("contentGroupBoxTitle") );
    } } );
    boxtitle = we.getText();
    System.out.println("boxtitle=" + boxtitle + "=");

    -------------------------------
    I also tried this similar method and got the same result :

    Wait<WebDriver> wait = new WebDriverWait(driver, 20);
    WebElement we = wait.until( visibilityOfElementLocated(
    By.cssSelector("div.contentGroupBoxTitle") ) );
    public ExpectedCondition<WebElement> visibilityOfElementLocated(final By
    by) {
    return new ExpectedCondition<WebElement>() {
    public WebElement apply(WebDriver driver) {
    WebElement element = driver.findElement(by);
    return element.isDisplayed() ? element : null;
    }
    };
    }
    -------------------------------

    java.lang.NullPointerException
    at
    com.google.common.base.Preconditions.checkNotNull(Preconditions.java:191)
    at org.openqa.selenium.support.ui.FluentWait.<init>(FluentWait.java:94)
    at
    org.openqa.selenium.support.ui.WebDriverWait.<init>(WebDriverWait.java:66)
    at
    org.openqa.selenium.support.ui.WebDriverWait.<init>(WebDriverWait.java:40)
    at tr.reporting.pages.MenuPage.isLoaded(MenuPage.java:78)
    at
    org.openqa.selenium.support.ui.LoadableComponent.get(LoadableComponent.java:45)
    at tr.reporting.pages.MenuPage.<init>(MenuPage.java:40)
    at tr.reporting.BaseTests.testLogin(BaseTests.java:94)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at
    org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
    at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
    at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
    at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
    at
    org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
    at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
    at org.testng.TestRunner.privateRun(TestRunner.java:767)
    at org.testng.TestRunner.run(TestRunner.java:617)
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
    at org.testng.SuiteRunner.run(SuiteRunner.java:240)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1197)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1122)
    at org.testng.TestNG.run(TestNG.java:1030)
    at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
    at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)
    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/9XxW1yhM8vQJ.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Umesh pandey at Oct 10, 2013 at 2:22 pm
    Webdriver object has null value.
    On Friday, 5 October 2012 04:16:37 UTC+5:30, Jon Thor Austen wrote:

    I haven't seen this error message before until I moved to this latest
    build. This same error happens on Firefox 14, 15.1, and 16. I'm using
    32-bit JDK 1.6_027. Using TestNG 6.3. Using Selenium 2.25.0 .

    My code that generates this error is typical and looks something like this:

    -------------------------------
    final WebElement we = (new WebDriverWait(driver, 10))
    .until( new ExpectedCondition<WebElement>() {
    @Override
    public WebElement apply(WebDriver d) {
    return d.findElement( By.className("contentGroupBoxTitle") );
    } } );
    boxtitle = we.getText();
    System.out.println("boxtitle=" + boxtitle + "=");

    -------------------------------
    I also tried this similar method and got the same result :

    Wait<WebDriver> wait = new WebDriverWait(driver, 20);
    WebElement we = wait.until( visibilityOfElementLocated(
    By.cssSelector("div.contentGroupBoxTitle") ) );
    public ExpectedCondition<WebElement> visibilityOfElementLocated(final By
    by) {
    return new ExpectedCondition<WebElement>() {
    public WebElement apply(WebDriver driver) {
    WebElement element = driver.findElement(by);
    return element.isDisplayed() ? element : null;
    }
    };
    }
    -------------------------------

    java.lang.NullPointerException
    at
    com.google.common.base.Preconditions.checkNotNull(Preconditions.java:191)
    at org.openqa.selenium.support.ui.FluentWait.<init>(FluentWait.java:94)
    at
    org.openqa.selenium.support.ui.WebDriverWait.<init>(WebDriverWait.java:66)
    at
    org.openqa.selenium.support.ui.WebDriverWait.<init>(WebDriverWait.java:40)
    at tr.reporting.pages.MenuPage.isLoaded(MenuPage.java:78)
    at
    org.openqa.selenium.support.ui.LoadableComponent.get(LoadableComponent.java:45)
    at tr.reporting.pages.MenuPage.<init>(MenuPage.java:40)
    at tr.reporting.BaseTests.testLogin(BaseTests.java:94)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at
    org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
    at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
    at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
    at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
    at
    org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
    at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
    at org.testng.TestRunner.privateRun(TestRunner.java:767)
    at org.testng.TestRunner.run(TestRunner.java:617)
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
    at org.testng.SuiteRunner.run(SuiteRunner.java:240)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1197)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1122)
    at org.testng.TestNG.run(TestNG.java:1030)
    at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
    at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)
    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
    To post to this group, send email to selenium-users@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/c4f81cc7-4460-4689-b147-ee462a340ab2%40googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupselenium-users @
categoriesselenium
postedOct 4, '12 at 10:54p
activeOct 10, '13 at 2:22p
posts3
users3
websiteseleniumhq.org

People

Translate

site design / logo © 2022 Grokbase