Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-63717

Not able to use TestNG Results Plugin in Jenkins Pipeline

XMLWordPrintable

      Hello,

       

      I am using the groovy to use the insatlled TestNG plugin but doesn't work. Below are the errors i get while using this:  step([$class: 'Publisher']): Publish TestNG Results

      88: expecting ')', found ':' @ line 88, column 35.
      [($class: 'Publisher') : Publish TestNG Results, reportFilenamePattern: './target/surefire-reports/testng-results.xml']
      ^

      WorkflowScript: 7: Expected a step @ line 7, column 51.
      ([$class: 'Publisher']) : Publish ........
                                       ^
      WorkflowScript: 8: unexpected token: TestNG @ line 8, column 33.
      Publish TestNG Results
      ^

      java.lang.NoSuchMethodError: No such DSL method 'publishers' found among steps

      88: expecting ')', found 'Publisher' @ line 88, column 36.
      [($class 'Publisher') Publish TestNG Results, reportFilenamePattern: './target/surefire-reports/testng-results.xml']
      ^

      I have referred to many TestNG plugin documentations including:
      https://www.jenkins.io/doc/pipeline/steps/testng-plugin/#stepclass-publisher-publish-testng-results
      but the issue doesn't get resolved.
      Kindly let me know if we can use this plugin using groovy.

       
      i have tried using it under pipeline, stages, steps, have tried all the possible combinations but doesn't work
       

       

       

        1. jenkins4.PNG
          jenkins4.PNG
          268 kB
        2. jenkins3.PNG
          jenkins3.PNG
          267 kB
        3. jenkins2.PNG
          jenkins2.PNG
          310 kB
        4. jenkins1.PNG
          jenkins1.PNG
          299 kB

            Unassigned Unassigned
            uzair_bhat uzair bhat
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: