TestNG not running tests in testing suite

前端 未结 15 3119
礼貌的吻别
礼貌的吻别 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:18

    In my case, the @Test annotation was imported automatically by IDE as import org.junit.Test.

    After changing it to import org.testng.annotations.Test the tests got picked up correctly.

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

    I was facing the same issue , i have updated/installed TestNG from eclipse marketplace it worked for me

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

    In my case, the test was accidentally marked as "enabled = false" inside the @Test(...). Make sure the value for you is marked as "true".

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

    I experienced a similar issue and it was resolved by performing a project clean within Eclipse (Project-> Clean-> Clean Selected project)

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

    There were two problems in the code:
    1. This was because, my @Test method was calling another method which will return a Boolean. Once I commented the same @Test and the method, the whole testNG xml started working.
    2. Second mistake was , I was using the below ,that was a wrong assignment of Poi Classes. Workbook WB = new XSSFWorkbook(FIS); Sheet WSh= WB.getSheetAt(1); I changed the above to below: XSSFWorkbook WB = new XSSFWorkbook(FIS); XSSFSheet WSh= WB.getSheetAt(1); After both of those above corrections, the script started working.

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

    Very simple but sometimes hard to spot. @Test is not picked when no data is returned by the corresponding dataprovider.

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