Used to explicitly specify the name of an argument of a method that is marked as a keyword for keyword-driven testing.
[AttributeUsageAttribute(AttributeTargets.Parameter)] public class ArgumentAttribute : Attribute
<AttributeUsageAttribute(AttributeTargets.Parameter> Public Class ArgumentAttribute Inherits Attribute
Name | Description |
---|---|
Name Property (ArgumentAttribute) | Gets the name of the argument. |
Use the following code sample to create the keyword Login with the arguments username and password:
[Keyword] public void Login([Argument("Name of the user")] string username, [Argument("Password of the user")] string password) { // keyword implementation }
<Keyword()> Public Sub Login(<Argument("Name of the user")> username As String, <Argument("Password of the user")> password As String) ' keyword implementation End Sub
Use one of the following code samples to create the keyword Login with the arguments username and password, without using a description for the arguments:
[Keyword] public void Login(string username, string password) { // keyword implementation }
[Keyword] public void Login([Argument] string username, [Argument] string password) { // keyword implementation }
<Keyword()> Public Sub Login(username As String, password As String) ' keyword implementation End Sub
<Keyword()> Public Sub Login(<Argument> username As String, <Argument> password As String) ' keyword implementation End Sub