Is there a way to specify parameters for included methods in TestNG suite.xml?

前端 未结 2 1542
借酒劲吻你
借酒劲吻你 2021-01-24 08:01

I\'m writing a suite.xml for an own testframework based on TestNG. My xml file looks like:


&l         


        
2条回答
  •  悲&欢浪女
    2021-01-24 08:27

    For some reason testng 6.4 and up no longer supports parameter inside the method.

    But if you revert back to 6.3 i think, is the last version that supported that. I have same issue and recall that it used to work in our framework, so i started reverting back one version at a time. Why they took it out is beyond me.

    With 6.3 you could do:

    
            
              
            
            
               
            
            ...
            ...
    
    

    and somewhere with listener call

    iTestContext.getCurrentXmlTest().getParameters()
    

    Hope it helps. If too late for you, maybe good info for someone else.

    Edit: I LIED! You can still get it with latest testng ;)

    iTestResult.getMethod().findMethodParameters(iTestContext.getCurrentXmlTest())
    

提交回复
热议问题