Integration with Visual Studio and Spira Team

Friday, November 9, 2012
Avatar
Can we execute test cases from visual studio (.NET) with NUnit/Selenium and get the results (Execution Status: pass/fail) updated in Spira ?
(Assuming that we have created a testSet of type: Automated, and Automation tab fields automation engine etc. updated for the Testcase)
3 Replies
Friday, November 9, 2012
Avatar
re: sureshp Friday, November 9, 2012

Hi Suresh

There are two separate things that need to be sorted out:

1) Indepdendent of RemoteLaunch, you need to have the Selenium .NET coded tests execute and report back to SpiraTeam

2) RemoteLaunch needs to be able to initiate the tests using the Command-Line extension. What extension do you have loaded into RemoteLaunch currently? You cannot use the Selenium one because that's designed for the situation when RemoteLaunch calls Selenium directly rather than from .NET code.

To fix the first issue first, can you please make sure that the Add-In is loaded correctly in NUnit and when you right-click on the SpiraTest NUnitAddIn dll and choose Properties (in Windows Explorer), it is not listed as "Blocked", if so, click Unblock.

Once we can get the tests to report back, then we can look at the RemoteLaunch issue.

Regards

Adam

Sunday, November 11, 2012
Avatar
re: inflectra.david Friday, November 9, 2012
Thanks adam, for the clarification. (I am clear now with

I even tried with the First one. (I have unblocked NUnit Addin). But Still ,I dint see the execution status updated for the given test case in Spira Team site.

Following is the code I wrote.

using System;
using NUnit.Framework;
using Inflectra.SpiraTest.AddOns.SpiraTestNUnitAddIn.SpiraTestFramework;
using OpenQA.Selenium;
//using OpenQA.Selenium.Firefox;
using OpenQA.Selenium.IE;
using Selenium;

namespace SeleniumSampleTest
{
    /// <summary>
    /// Sample test fixture that tests the NUnit SpiraTest integration with the
    /// Selenium-RC .NET Driver
    /// </summary>
    [
    TestFixture,
    SpiraTestConfiguration("http://localhost/SpiraTeam", "fredbloggs", "fredbloggs", 1, 1,12, SpiraTestConfigurationAttribute.RunnerName.Selenium)
    ]
    public class GoogleTest2
    {
        private static ISelenium selenium;

        private IWebDriver browser;
      

        [SetUp]
        public void SetupTest()
        {
            browser = new InternetExplorerDriver();
            browser.Navigate().GoToUrl("http://www.google.com");
        }

        [TearDown]
        public void TeardownTest()
        {
            browser.Close();
        }

        /// <summary>
        /// Sample test that searches on Google, passes correctly
        /// </summary>
        [Test, SpiraTestCase(18)]
        public void GoogleSearch2()
        {
            IWebElement txtbox = browser.FindElement(By.Id("gbqfqw"));
            txtbox.SendKeys("spira");

            IWebElement btnSearch = browser.FindElement(By.Name("btnG"));
            btnSearch.Click();

            var results = browser.FindElements(By.XPath("//a"));

            Assert.IsTrue(results.Count > 0);
}
        }

I ran the above test case from my solution as well as from Nunit.



Spira Configuration:




Selenium is the - Selenium Webdriver configured in Administration tab.

- Suresh

Tuesday, November 13, 2012
Avatar
re: sureshp Sunday, November 11, 2012
Hi Adam,
I am successful after following your instructions. Thanks for the support.
But one last thing, this is working from NUnit.exe (GUI), which is returning back the results to Spira and not When I run from Visual Studio.


- Suresh

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: Friday, November 9, 2012
  • Last Reply: Tuesday, November 13, 2012
  • Replies: 3
  • Views: 2969