ArgumentAttribute Class

Description

Used to explicitly specify the name of an argument of a method that is marked as a keyword for keyword-driven testing.

Syntax

C#
[AttributeUsageAttribute(AttributeTargets.Parameter)]
public class ArgumentAttribute : Attribute
VB
<AttributeUsageAttribute(AttributeTargets.Parameter>
Public Class ArgumentAttribute Inherits Attribute

Properties

Name Description
Name Property (ArgumentAttribute) Gets the name of the argument.

Example: Creating a keyword with two arguments

Use the following code sample to create the keyword Login with the arguments username and password:

C#
[Keyword]
public void Login([Argument("Name of the user")] string username, [Argument("Password of the user")] string password) {
  // keyword implementation
}
VB
<Keyword()>
Public Sub Login(<Argument("Name of the user")> username As String, <Argument("Password of the user")> password As String)
  ' keyword implementation
End Sub

Example: Using arguments without a description

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:

C#
[Keyword]
public void Login(string username, string password) {
  // keyword implementation
}
[Keyword]
public void Login([Argument] string username, [Argument] string password) {
  // keyword implementation
}
VB
<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