Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1097747
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:28:37+00:00 2026-05-17T00:28:37+00:00

Multi-Test TestNG.xml file results in java.lang.NullPointerException Hello Quality Team, I need help getting TestNG

  • 0

Multi-Test TestNG.xml file results in java.lang.NullPointerException

Hello Quality Team,

I need help getting TestNG to run multiple tests from one XML file. So far my efforts to do this result in a java.lang.NullPointerException OR the test(s) fake_execute=”says it ran…but how can it have run if it didn’t start selenium?”

One final note: All of the tests run SUCCESSFULLY when run using a stand-alone XML file

Below is my XML file

   <test name="Simple example">
       <groups>
       <run>
   <include name="groupA" />
   <include name="groupB" />
       </run>
   </groups>
   <classes>
      <class name="test.LoginPageTest"/>
      <class name="test.PurchaseItemTest"/>
     </classes>
   </test>
</suite>

When TestNG/Selenium throws the Null Pointer Error it is always failing on a selenium.open(URL), selenium.windowMaximize(), selenium.windowFocus().

I use a SeleneseTestNGHelper file that starts Selenium and handles some base-level selenium functionality.

Here is the command from the Test that my test is failing on

@Test (dataProvider = "Login_Test", groups = {"groupA"})
 public void testLoginPage(String string1, String string2) throws Exception { 
 // Super-size & Focus on Selenium Test Window
 //selenium.windowMaximize();
 //selenium.windowFocus();

        // Start your motors and get to testing
        try {  selenium.open("http://www.google.com");  }
        catch(Throwable e)
        {e.printStackTrace(); }
}

Here is the method called

 public void open(String string) {
  selenium.open(string);
  selenium.windowMaximize();
  selenium.windowFocus();
 }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T00:28:38+00:00Added an answer on May 17, 2026 at 12:28 am

    I don’t see any code that actually initializes your selenium field, where is this happening?

    Wherever it is, make sure it’s initialized in a @BeforeMethod or @BeforeClass.

    Also, here is some relevant documentation:

    http://testng.org/doc/selenium.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've written a multi-threaded WTL util to stress test an in-house service. Comms threads
I just found a TestNG test case that uses Spring to provide its data
I can't see where I went wrong here: var TestString = '+test +testing multi
Background I have written a test suite in mstest which has a template XML.
We need to test a long process of steps for one Feature. From logging
I'm having trouble creating the recipes for a multi-variate test. For example, if I
I'm testing a multi-user Android APK that I'm developing. For my test requirements I
I have a C++ function which returns a multi-line std::string . In the test-case
I am making a multi-table fulltext query.But I met some question. I need make
I have test.yoursite.com parked on example.com and have a SSL multi-domain certificate. What I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.