- Release Notes
- Getting Started
- Setup and Configuration
- Automation Projects
- Dependencies
- Types of Workflows
- File Comparison
- Automation Best Practices
- Source Control Integration
- Debugging
- The Diagnostic Tool
- Variables
- Arguments
- Imported Namespaces
- Trigger-based Attended Automation
- Recording
- UI Elements
- Control Flow
- Selectors
- Object Repository
- Data Scraping
- Image and Text Automation
- Citrix Technologies Automation
- RDP Automation
- Salesforce Automation
- SAP Automation
- VMware Horizon Automation
- Logging
- The ScreenScrapeJavaSupport Tool
- The WebDriver Protocol
- Test Suite - Studio
- Extensions
- Troubleshooting
- About troubleshooting
- Microsoft App-V support and limitations
- Internet Explorer X64 troubleshooting
- Microsoft Office issues
- Identifying UI elements in PDF with Accessibility options
- Repairing Active Accessibility support
- Automating Applications Running Under a Different Windows User
- Validation of large Windows-legacy projects takes longer than expected
ST-NMG-002 - Arguments Naming Convention
ST-NMG-002
Scope: Workflow
This rule analyzes all arguments in the project and determines whether they follow the specific convention.
Arguments in the project should follow a specific naming convention to make it easier to understand the project and maintain it. The argument name should be meaningful and include an indication of its type:
- in – the argument can only be used within the given project.
- out – the argument can be used to pass data outside of a given project.
- io – the argument can be used both within and outside of a given project.
Make sure all arguments follow the naming convention. The default Regex expression for this rule is:
- InRegex:
^in_(dt_)?([A-Z]|[a-z])+([0-9])*$
- OutRegex:
^out_(dt_)?([A-Z]|[a-z])+([0-9])*$
- InOutRegex:
^io_(dt_)?([A-Z]|[a-z])+([0-9])*$
.
According to the above regex expression, the argument matches the expression if it starts with a prefix, followed by a lower or upper case letter, and a number.
in_HelloWorld
then it is validated by the rule. Other examples of argument names that follow this regex rule are: out_HelloWorld
and io_Helloworld
.
In the Project Settings window, select the Workflow Analyzer tab. Find and select the rule, as in the image below:
[A-Z]
part of the expression for In arguments, the search pattern becomes ^in_(dt_)?([a-z])+([0-9])*$
. Now the rule checks if In arguments start with a lower case letter after the prefix.
[a-z]|[A-Z])
, then the rule becomes ^in_(dt_)?([A-Z]|[a-z]|[a-z]|[A-Z])+([0-9])*$
, and recognizes in_HelloWonderfulWorld
as a valid In argument name.
The default regex expression for this rule can be changed to another naming convention. Check the list below:
Camel case
The camel case convention specifies that each word in the middle of the argument name begins with a capital letter, with no intervening spaces or punctuation.
^in_(dt_)?([A-Z]|[a-z]|[0-9])+([A-Z]|[a-z]|[0-9])
.
in_Hello1World2
, in_helloWorld
, in_Hello1World
.
Pascal case
The Pascal case naming convention specifies that the argument name must contain concatenated capitalized words.
^in_(dt_)?([A-Z]|[0-9])+([A-Z]|[a-z]|[0-9])
.
in_Hello1World2
, in_HelloWorld
, in_Hello1World
.
Kebab case
The Kebab case naming convention is similar to snake case, except that it replaces spaces with hyphens rather than underscores.
^in_(dt_)?([a-z]|[A-Z]|[0-9])+‐([a-z]|[A-Z]|[0-9])
in_Hello1‐World2
, in_Hello‐World
.
The default values for ST-NMG-002 Regex are:
- InRegex:
^in_(dt_)?([A-Z]|[a-z])+([0-9])*$
- OutRegex:
^out_(dt_)?([A-Z]|[a-z])+([0-9])*$
- InOutRegex:
^io_(dt_)?([A-Z]|[a-z])+([0-9])*$
.
To reset these values to default right-click a rule in the Project Settings window, and then click Reset to default.