Thread

Skip Navigation LinksForums > SpiraTest Forums > SpiraTest Issues & Questi... > C# - The SpiraTestConfigu...

C# - The SpiraTestConfiguration "Named Parameters" options throw errors for nullable keywords. RSS Feed

Wednesday, July 23, 2014
Hi all,

Using a SpiraTestConfiguration with all of the parameters, e.g.,
SpiraTestConfiguration("https://fakeurl.spiraservice.net", "FakeUserAccount", "FakeUserPassword", TestDataVerification.ProjectId, TestDataVerification.ReleaseNumber, TestDataVerification.TestSetId)
I am able to successfully report results to the server. When I attempt to provide named parameters, e.g.
 SpiraTestConfiguration(
            Url = "https://HeyURLHERE.spiraservice.net",
            Login = "MyAutomationAccount", // Not actual username
            Password = "MyAutomationPassword", // Not actual password
            ProjectId = TestDataVerification.ProjectId, // public const int ProjectId
            TestSetId = TestDataVerification.TestSetId // public const int TestSetId
            // ^^ Error here: 'TestSetId' is not a valid named attribute argument because it is not a valid attribute parameter type   
               )
I'm greeted by a compile time error, "'TestSetId' is not a valid named attribute argument because it is not a valid attribute parameter type". It is listed as a parameter type, so am I wrong in assuming that I should be able to provide an assignment to it?

Any help is welcome, it's very appreciated. Thank you.
9 Replies
Adam SAdam S
re: Daniel Baldwin on Wednesday, July 23, 2014
Friday, July 25, 2014

Hi Daniel

I think the issue is that the expected parameters are camelCase not PascalCase, i.e. use testSetId = XXX instead of TestSetId = XXXX

 SpiraTestConfiguration(
            url = "https://HeyURLHERE.spiraservice.net",
            login = "MyAutomationAccount", // Not actual username
            password = "MyAutomationPassword", // Not actual password
            projectId = TestDataVerification.ProjectId, // public const int ProjectId
            testSetId = TestDataVerification.TestSetId // public const int TestSetId  
               )

Regards

Adam

Daniel BaldwinDaniel Baldwin
re: Adam S on Friday, July 25, 2014
Monday, July 28, 2014
Hey Adam, thanks for the response.

Unfortunately using camelCase produces a different error, "...SpiratestConfigurationAttribute does not contain a definition for testSetId"

All of the other named parameters are in PascalCase. I believe the issue has to do with TestSetId being a nullable type (int?) instead of just an int.
Gangotri SikheriaGangotri Sikheria
re: Adam S on Friday, July 25, 2014
Friday, December 12, 2014
Hi Adam,

Is Spira Configuration support function parameter, because right now i am not able to run my spira test with function parameter in c#

my code is :

  [Test, SpiraTestCase(418)]
       [TestCaseSource(typeof(AdminModel), "UserValidation")]
          public void PublicAdminSpira(string userName, string password) 
          {
              var page = this.OpenPage<LoginPage>(this.AdminModel.LoginPagePath);
              page.Maximize();
              page.FillInForm(userName, password, false);
              page.Login();
              page.Logout();
            

          }

 i have pass two parameter value and run through nunit, than its not shows passed /failed status in spira test ID.

now if i am not user parameter and run through nunit than it shows status with spira test id as passed/failed for example-
 [Test, SpiraTestCase(418)]
    
          public void PublicAdminSpira() 
          {
              var page = this.OpenPage<LoginPage>(this.AdminModel.LoginPagePath);
              page.Maximize();
              page.FillInForm("username", "passwored", false);
              page.Login();
              page.Logout();
            

          }

please replay...
Thanks
Gangotri


Jim R.Jim R.
re: Daniel Baldwin on Monday, July 28, 2014
Friday, December 12, 2014
Hi Daniel

Yes that could be the case.

Regards
Jim
Jim R.Jim R.
re: Gangotri Sikheria on Friday, December 12, 2014
Friday, December 12, 2014
Hi Gangotri

Could you please log this as a new thread.

Regards
Jim
Gangotri SikheriaGangotri Sikheria
re: Jim R. on Friday, December 12, 2014
Tuesday, December 16, 2014
Hi Jim,

I have already logged new thread for the same, please replay as soon as possible, because i have to use this in my current automation.

Thanks
Gangotri Sikheria
Gangotri SikheriaGangotri Sikheria
re: Gangotri Sikheria on Tuesday, December 16, 2014
Tuesday, December 16, 2014
Hi Jim,

I have also logged tared as well as new  help desk ticket ticket id is: TK17176


Thanks
Gangotri
Elise B.Elise B.
re: Gangotri Sikheria on Tuesday, December 16, 2014
Tuesday, December 16, 2014
Hi Gangotri,

Jim already replied a few days ago. See

Regards,
Elise
Adam SAdam S
re: Elise B. on Tuesday, December 16, 2014
Tuesday, December 16, 2014
Hi Gangotri

We have checked and our Add-In does not support such parameterized tests.

Since NUnit 3.0 (in alpha) is getting rid of the entire plugin system we are looking at ways to replace our current add-in once NUnit 3.0 has been released, so no changes are planned to the current add-in at this time.

Regards

Adam

Tagged
Statistics
  • Started: 7/23/2014
  • Last Reply: 12/16/2014
  • Replies: 9
  • Views: 885
Powered by KronoDesk v1.1.0.15 | © Copyright Inflectra Corporation 2011-2016 | Licensed to Inflectra Corporation.