title: java.lang.NullPointerException is displayed while executing TestNg.xml file in selenium Webdriver
body: <p>I am new to Selenium WebDriver.</p>
  
  <p>Prog:</p>
  
  <pre><code>import org.testng.annotations.BeforeMethod;
  import org.testng.annotations.Test;
  public class sample1 
  {
      @BeforeMethod
      public void BeforeMethod()
      {
          System.out.println("This is Before Method");
      }
      @Test
      public void f1()
      {
          System.out.println("This is f1 method");
      }
      @Test
      public void f2()
      {
          System.out.println("This is f2 Method");
      }
  }
  </code></pre>
  
  <p>TestNG XML File:</p>
  
  <pre><code>&lt;suite name="s1"&gt;
      &lt;test name="t1"&gt;
          &lt;Classes&gt;
              &lt;Class name="sample1" /&gt;
              &lt;methods&gt;
                  &lt;include name= "f1" /&gt;
                  &lt;include name= "f2" /&gt;
              &lt;/methods
          &lt;/Classes&gt;
      &lt;/test&gt;
  &lt;/suite&gt;
  </code></pre>
  
  <p>While executing the above xml file Java Null pointer error is displayed.</p>
  
  <p>Can any one please help me.</p>
  
  <p>Here is the Exeception getting:</p>
  
  <p><code>
      org.testng.TestNGException: java.lang.NullPointerException
      at org.testng.TestNG.initializeSuitesAndJarFile(TestNG.java:341)
      at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:88)
      at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
      at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)
      Caused by: java.lang.NullPointerException
      at org.testng.xml.TestNGContentHandler.xmlMethod(TestNGContentHandler.java:456)
      at org.testng.xml.TestNGContentHandler.endElement(TestNGContentHandler.java:690)
      at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown     Source)
      at     com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknow    n Source)
      at             com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver    .next(Unknown Source)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown     Source)
      at     com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
      at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
      at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
      at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
      at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
      at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
      at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(Unknown Source)
      at javax.xml.parsers.SAXParser.parse(Unknown Source)
      at org.testng.xml.XMLParser.parse(XMLParser.java:39)
      at org.testng.xml.SuiteXmlParser.parse(SuiteXmlParser.java:17)
      at org.testng.xml.SuiteXmlParser.parse(SuiteXmlParser.java:10)
      at org.testng.xml.Parser.parse(Parser.java:168)
      at org.testng.TestNG.initializeSuitesAndJarFile(TestNG.java:311)
      ... 3 more
  </code></p>
  
  <p>Thanks &amp; Regards</p>
  
  <p>I have changed the capital letters in the Tag names to small letters, Then i am getting the below exception:</p>
  
  <pre><code>org.testng.TestNGException: 
  Cannot find class in classpath: ChangePage
      at org.testng.xml.XmlClass.loadClass(XmlClass.java:81)
      at org.testng.xml.XmlClass.init(XmlClass.java:73)
      at org.testng.xml.XmlClass.&lt;init&gt;(XmlClass.java:59)
      at org.testng.xml.TestNGContentHandler.startElement(TestNGContentHandler.java:543)
      at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown     Source)
      at     com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(Unknown     Source)
      at     com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unkn    own Source)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
      at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
      at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
      at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
      at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
      at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
      at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(Unknown Source)
      at javax.xml.parsers.SAXParser.parse(Unknown Source)
      at org.testng.xml.XMLParser.parse(XMLParser.java:39)
      at org.testng.xml.SuiteXmlParser.parse(SuiteXmlParser.java:17)
      at org.testng.xml.SuiteXmlParser.parse(SuiteXmlParser.java:10)
      at org.testng.xml.Parser.parse(Parser.java:168)
      at org.testng.TestNG.initializeSuitesAndJarFile(TestNG.java:311)
      at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:88)
      at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
      at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)
  </code></pre>