Forum Discussion

raja2's avatar
raja2
Contributor
7 years ago
Solved

How to Execute Testng Suite (Testng.xml) with QA complete without TestComplete?

Hi Team,

 

I want to execute TestNG Suite (TestNG.xml) file from QA complete without TestComplete.   Please find the attached screenshot.

 

  • Is it possible to run the testng suite ?
  • I have created a testng suite with "n" number of java classes in it
  • How can i execute such suite.xml in QA complete ?
  • Can i execute directly testng suite.xml without mentioning all the classes in it in Automation ?

Can i execute testng suite.xml file from Custom Args: ?

 

Thanks in Advance !

 

Regards,

Poovaraj

  • Hi Poovaraj,

     

    Thank you for your post!

    When you specify a Test Class in QAC Automation, Test Agent generates a command line like this:

    java org.testng.TestNG -testclass MyPack.MyClass

     

    To run a TestSuite you need the command line like this:

    java org.testng.TestNG testng1.xml

     

    So, don't specify the Test Class (leave this field empty) and fill the Custom Args field with the name of your Test Suite. Please see a sample screenshot attached.

     

    Workaround: user can configure a Maven project to run a TestNG test suite (http://testng.org/doc/maven.html), and then run this Maven project from QAC.

14 Replies

  • Nastya_Khovrina's avatar
    Nastya_Khovrina
    SmartBear Alumni (Retired)

    Hi Poovaraj,

     

    Thank you for your post!

    When you specify a Test Class in QAC Automation, Test Agent generates a command line like this:

    java org.testng.TestNG -testclass MyPack.MyClass

     

    To run a TestSuite you need the command line like this:

    java org.testng.TestNG testng1.xml

     

    So, don't specify the Test Class (leave this field empty) and fill the Custom Args field with the name of your Test Suite. Please see a sample screenshot attached.

     

    Workaround: user can configure a Maven project to run a TestNG test suite (http://testng.org/doc/maven.html), and then run this Maven project from QAC.

    • raja2's avatar
      raja2
      Contributor

       

      Thanks for your reply. It is working fine 

      • shirishnagar's avatar
        shirishnagar
        Occasional Contributor

        Hi Poovaraj,

         

        I am facing similar issue,

         

        having working TestNG framework with Maven in one of the VMM. Have to configure to make it run through QA Complete, can you please highlight some tips how exactly has to configure.

         

        I did the below thing

        - Configure the TestAgent (hope I did it right)

        - then add new row in one of the TCs in automation tab

        - Zipped the Project folder (TestNG-Maven) and upload it to QA complete while adding new row.

        Checked the checkbox for Maven

        - Configure and then schedule it

         

        as per schedule time, something is happening it results fail. I am observing that it initiates command prompt but get close in few seconds and results as FAIL in the run history.

         

        Also can you please confirm if this settings in attached snapshot are correct are not?

        [^TestRunner.JPG]

         

         

        Any suggestion will be appreciable.

         

        Regards,

        Shirish