TestNG not running tests in testing suite

前端 未结 15 3355
礼貌的吻别
礼貌的吻别 2021-02-19 20:51

I\'m trying to run a testing suite using XML and TestNG, but I\'m always getting the same message using both: Eclipse and the command line:

[TestNG] Running:
  /         


        
相关标签:
15条回答
  • 2021-02-19 21:39

    I also had this problem, and none of the above solutions worked. Restarting Eclipse, however, did. I know this seems like an unnecessary answer, but I myself would have saved a lot of time if I had done it sooner, so I'll post it anyway.

    0 讨论(0)
  • 2021-02-19 21:43

    Apparently, TestNG is wrong regarding generating the XML file for the testing suite.

    Even though following their instructions to the letter, my tests were not running. I ended up with this testng.xml file and my tests, started to run:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
    <suite name="TestingSuite" parallel="none">
      <test name="Test1">
        <classes>
          <class name="tests.Page1"/>
        </classes>
      </test>
        <test name="Test 2">
            <classes>
                <class name="tests.Page2"/>
            </classes>
        </test>
    </suite>
    
    0 讨论(0)
  • 2021-02-19 21:43

    I had this same issue, here is what worked for me:

    1. I put all of the TestNG libraries in a separate lib folder in my project

      a. com.beust.jcommander_1.72.0.jar

      b. org.apache-extras.beanshell.bsh_2.0.0.b6.jar

      c. org.testng_6.14.2.r201802161450.jar

      d. or.yaml.snakeyaml_1.17.0.jar

    2. I also put a copy of selenium-server and chromedriver in the lib folder as well

    3. From my project folder (with testng.xml located in the project root) I ran:

      java -cp .\lib\*;.\target\classes org.testng.TestNG testng.xml

    0 讨论(0)
提交回复
热议问题