Tests run from TestNG are not recorded in SpiraTest

Wednesday, January 7, 2015 8:12:09 AM
I have tried integrating manual test cases in SpiraTest with TestNG(WebDriver), the automation script runs fine in the TestNG but the status of the test result is not recorded back in the Spira. There is no error thrown as such either. I  dont have any clue as to how to debug and find what is blocking the status update but no error is generated.

Here is the sample snippet code. Please help me debug the issue.

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.testng.Assert;
import org.testng.annotations.Test;

import com.inflectra.spiratest.addons.testnglistener.SpiraTestCase;
import com.inflectra.spiratest.addons.testnglistener.SpiraTestConfiguration;
import com.inflectra.spiratest.addons.testnglistener.TestRun;


@SpiraTestConfiguration(login = "*****", password = "****", projectId = 000331 , url = "*********", releaseId = -1,testSetId = -1)
   
@Test(groups={"unittest"})
public class SpiraIntegration {
   
    WebDriver driver = new FirefoxDriver();
    String url = "****";
    WebDriverWait wait = new WebDriverWait(driver,120);
   
   

@Test(groups={"unittest"})
  @SpiraTestCase(testCaseId =251477)
  public void VerifyLogin() throws IOException {
      driver.get(url);
      LoginPage oLogin = new LoginPage(driver);   
      wait.until(ExpectedConditions.presenceOfElementLocated(By.id("screenId")));
      oLogin.Login("admin","password");
      wait.until(ExpectedConditions.presenceOfElementLocated(By.id("main-content")));
      Assert.assertEquals(1, 1);
     ScreenShot.TakeScreenShot(driver, "LoginPage");
   
  }
 
}

5 Replies
Friday, January 9, 2015 3:55:50 PM
Avatar
re: kashi.anaganti on Wednesday, January 7, 2015 8:12:09 AM
Hi Kashi

The code looks correct, most likely you need to add the TestNG listener via. either the TestNG XML file or the command-line. Have you done that?

If you need more specific help, I'd log a support ticket.

Regards
Jim
Monday, January 12, 2015 2:00:07 AM
Avatar
re: inflectra.jimx on Friday, January 9, 2015
Thank  you Jim for your reply. I have not added the listener to the TestNG via xml or commandline, I just added it as an external library to my TestNG tests. Please suggest me how to add it via xml.
Thursday, October 15, 2015 10:23:35 AM
Avatar
re: inflectra.jimx on Friday, January 9, 2015
Hi Jim ,

I am also facing the same problem..I have already generated the TestNG xml but I wanted to know how to include the TestNG listener in the xml file.

<listeners>
      <listener class-name="  "/>
  </listeners>

It will be kind f you if you could help me out.

Best Regards,
Akmaize
Friday, October 16, 2015 5:09:40 AM
Avatar
re: inflectra.jimx on Friday, January 9, 2015
Hi Jim ,

I am also facing the same problem..I have already generated the TestNG xml but I wanted to know how to include the TestNG listener in the xml file.

<listeners>
      <listener class-name="  "/>
  </listeners>

It will be kind f you if you could help me out.

Best Regards,
Akmaize
Thursday, October 22, 2015 5:12:03 PM
Avatar
re: Antoaroo on Friday, October 16, 2015
Hi Akmaize,

In general, see Chapter 4 of the Automated Testing Integration Guide for instructions on setting up the integration. There is also a sample test fixture SimpleText.java provided with the SpiraTest listener installation.

To answer your specific question, include the listener as follows:

<listeners>
      <listener class-name="com.inflectra.spiratest.addons.testnglistener.SpiraTestListener" />
  </listeners>

Please log a Help Desk ticket if you are still having trouble.

Regards,
Elise
Statistics
  • Started: Wednesday, January 7, 2015 8:12:09 AM
  • Last Reply: Thursday, October 22, 2015 5:12:03 PM
  • Replies: 5
  • Views: 880