Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 99016

How to run mockito and selenium tests together using testng.xml as a single Testrunner?

$
0
0

The xml file is as follows:

Login Test is a selenium test class.

xlImportTest is mockito test class.

<?xml version="1.0" encoding="UTF-8"?>
     <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">

     <suite name="Suite">

       <test thread-count="5" name="LoginTest">
         <classes>
            <class name="newpackage.LoginPageCheck"/>
         </classes>
       </test> 

        <test thread-count="5" name="xlImportTest Test">
             <classes>
                <class name="test.xlImportTest"/>
            </classes>
        </test>

</suite>

<!-- Suite -->

I run the following testng.xml through a test runner as follows:

public static void main(String[] args) {


    TestListenerAdapter tla = new TestListenerAdapter();
    TestNG testng = new TestNG();
    testng.setOutputDirectory(cDateTime);

    List<String> suites = Lists.newArrayList();

    suites.add(file+"\\testng.xml");

    testng.setTestSuites(suites);

    testng.addListener(tla);

    testng.run();       

}

This shows the following error:

=====================================

Suite

Total tests run: 2, Failures: 0, Skips: 2

Configuration Failures: 2, Skips: 2

=====================================


Viewing all articles
Browse latest Browse all 99016

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>