0

I need some help running my testng testsuite from command line:

Project Structure

compiled classes

myproject\bin
myproject\bin\com\...

source classes

myproject\test
myproject\test\com\...

required libraries

myproject\libraries
myproject\libraries\xy.jar

test suite

myproject\test\com\...\test\mySuite.xml

command line call

cd myproject
java -cp libraries\* -Dtestng.test.classpath="bin\*;test\*" org.testng.TestNG test\com\...\test\mySuite.xml

result

[TestNG] Running:
  F:\...\myproject\test\com\...\test\mySuite.xml

===============================================
mySuite
Total tests run: 0, Failures: 0, Skips: 0
===============================================

UPDATE

mySuite.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="mySuite.xml" parallel="classes" thread-count="10">

    <test name="happy path">
        <packages>
            <package name="com...test.functional.happyPath" />
        </packages>
    </test>

    <test name="exception path">  
        <packages>
            <package name="com...test.functional.exceptionPath" />
        </packages>
    </test>

</suite>
eventhorizon
  • 2,977
  • 8
  • 33
  • 57
  • Testng need compiled test classes. Is it what your test directory contains? – juherr Aug 31 '15 at 16:45
  • Nope. The bin directory contains the compiled classes. But stepping into bin and calling "java -cp ..\libraries\* org.testng.TestNG com\...\test\mySuite.xml" ends in the same result... – eventhorizon Sep 01 '15 at 07:11
  • Yes, but where are your compiled test classes? In the bin folder too? – juherr Sep 01 '15 at 07:22
  • The project does only contain test classes. So the compiled tests/test-classes all placed in the bin folder. – eventhorizon Sep 01 '15 at 07:51
  • I read the following: "https://github.com/longhua/testng-test-classpath-property-issue-1" and then changed my command line call to "java -cp libraries\*;bin org.testng.TestNG test\com\...\test\mySuite.xml". THAT WORKED! – eventhorizon Sep 01 '15 at 07:53

1 Answers1

0

I read the following: http://github.com/longhua/testng-test-classpath-property-issue-1

After that I changed my command line call to:

java -cp libraries*;bin org.testng.TestNG test\com\...\test\mySuite.xml

That worked for me...

eventhorizon
  • 2,977
  • 8
  • 33
  • 57