Tests run from TestNG are not recorded in SpiraTest

Wednesday, January 7, 2015
Avatar
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
Avatar
inflectra.jimx
re: kashi.anaganti Wednesday, January 7, 2015
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
Avatar
re: inflectra.jimx 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
Avatar
re: inflectra.jimx 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
Avatar
re: inflectra.jimx 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
Avatar
re: Antoaroo 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

Spira Helps You Deliver Quality Software, Faster and With Lower Risk

And if you have any questions, please email or call us at +1 (202) 558-6885

 

Statistics
  • Started: Wednesday, January 7, 2015
  • Last Reply: Thursday, October 22, 2015
  • Replies: 5
  • Views: 3078