Importing TestNG/JUnit

If you have existing TestNG/JUnit you can now import them and use RedwoodHQ for their execution and results tracking. This can be a very useful feature since the framework allows for execution and results tracking of ANY Java/GROOVY code (API, REST/SOAP, etc.) or tool (Selenium, Appium, etc.).

Upload TestNG/JUnit Files

Before Importing test cases we first need to upload all the script files which contain all the code. In this example we’ll be using sample TestNG test cases which can be downloaded here: AmazonTests After you download the sample zip file make sure to unzip it in to any folder you want afterwards.

  1. Click on Scripts tab
  2. Expand ‘src’ folder in left pane
  3. Right click on ‘src’ folder, select New -> Upload Directories
  4. On a new popup screen navigate to folder where you have unzipped sample test cases to
  5. Left click on ‘AmazonTests’ folder and click on Open button
  6. Click ‘OK’ button for ‘Files have been uploaded.’ message box
  7. All files and folders are now uploaded in to RedwoodHQ
  8. Click on ‘Git Push’ button so that all users will be able to use these scripts

Import TestNG/JUnit Test Cases

Now that you have uploaded your script files we need to make sure that Test Case entries exist for each @Test method so they can be executed as part of Execution.

  1. Click on ‘Import Test Cases’ button
  2. On a ‘Select Test Cases to Import’ popup check the check-boxes for all tests and click on OK
  3. Click ‘OK’ button for ‘Imported 3 test cases.’
  4. Click on Test Cases tab
  5. You will now see all the test cases that were imported from newly uploaded files with names generated based on this pattern (which can be modified after import): <Package>.<Class Name>.<Method>
  6. Create a new test set and execution to run the new test cases

Execution from Script page

TestNG and JUnit tests can also be executed right in the Scripts IDE page that will run the script right on current client machine (make sure you have Agent installed on it). This can be very useful for creating/doing modifications to a script and then running a quick validation of it without running through Execution.

  1. Click on Scripts tab
  2. Expand ‘src’ folder in left pane
  3. Expand ‘AmazonTests’ folder
  4. Double click on ‘ProductSearching.java’
  5. Click on ‘Run TestNG/JUnit Test Case in opened script’ button (green play arrow)
  6. Check the check-box for ‘AmazonTests.ProductSearching.LordofTheRingsSearchSelenium’ test (only one can be selected at a time)
  7. Click on ‘OK’ button
  8. Test case runs through and the following result appears on the bottom ‘Output’ pane:
    Starting Test…
    [TestNG] Running: Command line suite
    =========================================== Command line suite Total tests run: 1, Failures: 0, Skips: 0 ===========================================
    Test Passed

Feedback

Thanks for your feedback.

Post your comment on this topic.

Please do not use this for support questions.
For customer support, please contact us here.

Post Comment

Sunny wrote: Nov 4, 2016

Finally, my team member has just submitted a complete working code of RedwoodHQ integration with Appium for mobile functional test automation.

We call it Wheat.

Here is the link .. https://github.com/Talentica/Wheat