Thread

Skip Navigation LinksForums > SpiraTest Forums > SpiraTest Issues & Questi... > Tests run from TestNG are...

Tests run from TestNG are not recorded in SpiraTest RSS Feed

Wednesday, January 7, 2015
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
Jim R.Jim R.
re: kashi V anaganti on Wednesday, January 7, 2015
Friday, January 9, 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
kashi V anagantikashi V anaganti
re: Jim R. on Friday, January 9, 2015
Sunday, January 11, 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.
Akmaize AntoarooAkmaize Antoaroo
re: Jim R. on Friday, January 9, 2015
Thursday, October 15, 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
Akmaize AntoarooAkmaize Antoaroo
re: Jim R. on Friday, January 9, 2015
Friday, October 16, 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
Elise B.Elise B.
re: Akmaize Antoaroo on Friday, October 16, 2015
Thursday, October 22, 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
Tagged
Statistics
  • Started: 1/7/2015
  • Last Reply: 10/22/2015
  • Replies: 5
  • Views: 547
Powered by KronoDesk v1.1.0.15 | © Copyright Inflectra Corporation 2011-2016 | Licensed to Inflectra Corporation.