List of Keyword - System Keywords 4


To learn how to use System keywords in Opkey, you can read Using System Keywords - New UI and Using System Keywords - Opkey Classic.
 

Now, let's go through the list of various system keywords to understand their utility.

 


1. SetValueToCSV 


This keyword updates the value in a CSV file where the starting row and column indexes are “1”. It takes “CSVFilePath”, “row number”, “column number” and “Value to set” as input parameters. Using this keyword you can set value to “.csv” extension type files. 


Test Object


Test Object Required?

Description

No

This keyword doesn’t take any object input argument.


Input Data


Input Data Required

Description

Input Value

Required 

This keyword requires the following data arguments as input: 

CSVFilePath: It takes the CSV file's path with the extension ".csv" (e.g. "D: EXECUTION TEST FILECSVFile.csv") 

rowNumber: Row ID of CSV file starting with index 1. It takes an "Integer" value as input. (e.g. "2") 

columnNumber: Column ID of CSV file starting with index 1. It takes an "Integer" value as input. (e.g. "2") 

Value to set: It takes the value which is to be set. It takes the "String" value as the input.



Output Data

  

                         Condition

                  Output Value

If the keyword passes successfully

True

If an error is there

False



Error conditions 


Condition 

Message 

Debug Info 

Invalid Data 

CSVFilePath: D: 

row number: 2 

columnNumber: 2 

Value to set: Opkey 

Argument Data Invalid (-13300)  

  

DESCRIPTION:  

The data value for one or more input arguments does not match the expected format or predefined set of values. Please review for spelling errors and capitalization. 

 
 

 

File not found at D: 

Blank Data 

CSVFilePath: (Blank) 

row number: 2 

columnNumber: 2 

Value to set: Opkey 

Argument Data Missing (-13200)  

  

DESCRIPTION:  

A step can't proceed without values for mandatory arguments. Unlike optional ones, compulsory arguments must be filled with data, which can come from a static entry, a previous step's output, or a global variable. Leaving them empty is not allowed. 

 
 

 

One or more of the arguments have not been provided a value 

Blank Data CSVFilePath: (Blank) 

row number: (Blank) 

columnNumber: (Blank) 

Value to set: (Blank) 

Argument Data Missing (-13200)  

  

DESCRIPTION:  

A step can't proceed without values for mandatory arguments. Unlike optional ones, compulsory arguments must be filled with data, which can come from a static entry, a previous step's output, or a global variable. Leaving them empty is not allowed. 

 
 

 

One or more of the arguments have not been provided

 

 


2. Function Keywords 

(I). CustomizeObject 


This keyword updates/customizes the properties of the specified object so that execution can be performed on the object even when properties are changed. It takes Property1, Value1, IsRegEx1, Property2, Value2, IsRegEx2, etc. 


This keyword is used to update the object properties. It takes an object input argument and a data input argument. 



Example 

If you want to get the cell value of the specified Shared Global DR, here is how you will use this keyword- 


  • Add CustomizeObject. 

  • Map Object. 

  • Provide Data Input Argument (Property1, Value1 & IsRegEx1) values. 


  • Similarly, provide Data Input Argument values for other object properties to be customized.


In the CustomizeObject Keyword, adding a Test Object argument was required. Hence, we have mentioned it is required.



Test Object


Test Object Required?

Description

Yes

object


Input Data


Input Data Required

Description

                          Property 1

Specify the property name of the mapped object. 

                          Value1

Specify the customized value of the property. 


IsRegEx1 


Specify the IsRegEx value 

Boolean (True/False). 




Output Data

  

                         
       Condition

                  Output Value

If the keyword passes successfully

True

If an error is there

False



Error conditions 


Condition 

Message 

Debug Info 

Object Not Given




Argument Data Missing 

 

 
 

 

Data not provided for argument: 'Object'. Expected StaticValue was empty. 

 

 


(II). GetAllErrorsInSuite 


This keyword generates a status file for all errors that occurred while executing a suite. It takes DirectoryPath and Snap (T/F) as input parameters. As this is a system keyword, there is no need for any plugin to be selected while executing this keyword. 


For example, to generate a status file of a test suite, you can give input parameters in the following manner:-


SetValueToCSV

 

Directory path

D: ExecutionErrors



The output will be the list of errors that occured.


In this Keyword, adding a Test Object argument was not required. Hence, we have mentioned it is not required.



Test Object


Test Object Required?

Description

No

This keyword doesn’t take any object input argument.


Input Data


Input Data Required

Description

                          Input Data Value

Required 

This keyword requires one data argument as input: 

Directory Path: This argument takes the path of the directory where the error file for failed steps is to be generated. (e.g.: "D: ExecutionErrors") 

Snap(True/False): Setting this option "True" or "False" generates a snapshot for the failed steps at the specified directory. It takes "Boolean" input. 



Output Data

  

                         
       Condition

                  Output Value

If the keyword passes successfully

True

If an error is there

False



Error conditions 


Condition 

Message 

Debug Info 

Invalid Data 

directory-path: ExecutionErrors 

Snap(True/False): False 

  

  

Invalid Data: 

directory-path: ctnl0037ExecutionErrors 

(Location not accessible) 

Snap(True/False): False 

  

  

Blank Data 

directory-path: (Blank) 

Snap(True/False): False 

  

  


(III). GetElementsCountByXpath 


This keyword counts a particular element from the specified XML. It takes FilePath or XML & Xpath as data input arguments.


Example 

If you want to get the cell value of the specified Shared Global DR, here is how you will use this keyword- 


  • Add GetElementsCountByXpath. 

  • Provide Data Input Argument (FilePath or XML & Xpath) values. 


In this Keyword, adding a Test Object argument was not required. Hence, we have mentioned it is not required.


Test Object


Test Object Required?

Description

No

This keyword doesn’t take any object input argument.


Input Data


Input Data Required

Description

                         FilePath or XML 

Specify the XML or map XML File. 

Xpath 


Specify the Xpath of the elements to be counted. 




Output Data

  

                         
       Condition

                  Output Value

If the keyword passes successfully

Element Value

If an error is there

0

 


Error conditions 


Conditions 

Message 

Debug Info 


Invalid File path or XML and Invalid Xpath are given. 


Argument Data Invalid (-13300) 


Data at the root level is invalid. Line1, position. 


No File path or XML & Xpath are given. 


Argument Data Missing (-13200) 


One or more of the arguments have not been provided a value. 


(IV)GetExecutionStatus 


This keyword generates a status file for all suite steps at runtime. It takes the Directory Path as an input parameter. This keyword is mostly used when the user needs an execution status for a suite. 


Example 


For example, if you want to generate a status file for all the suite steps at runtime, then you can use this keyword for the same. 



Test Object


Test Object Required?

Description

No

This keyword doesn’t take any object input argument.


Input Data


Input Data Required

Description

                         Input Value 

Required 

This keyword requires one data argument as input: 

Directory Path: It takes the path of the directory where the status file for all suite steps is to be generated. (e.g.: "D: ExecutionStatus") 

 



Output Data

  

                         
       Condition

                  Output Value

If the keyword passes successfully

True

If an error is there

False

 


Error conditions 



Conditions 


Message 

Debug Info 


Invalid Data: 

DirectoryPath: XYZ123@!# 


Argument Data Invalid (-13300)  

  

DESCRIPTION:  

The data value for one or more input arguments was not what was expected. This might happen when the input is expected in a specific format or should be chosen from a predefined set of values. Check for spelling errors and capsizing. 


The directory Path was not found 


Invalid Data: 

directory-path: ctnl0037Executionstatus 

(Location not accessible) 



 Blank Data 

 directory-path: (Blank


Argument Data Missing (-13200)  

  

DESCRIPTION:  

A step can't proceed without values for mandatory arguments. Unlike optional ones, compulsory arguments must be filled with data, which can come from a static entry, a previous step's output, or a global variable. Leaving them empty is not allowed. 


 The directory path can't    be blank 





(V). GetScreenHeight 

This keyword retrieves the height of the Screen at runtime. This keyword does not need any input arguments. 


Example

 

For example, if you want to get the height of the screen at runtime, then here is how you can use this keyword for the same. 


Test Object


Test Object Required?

Description

No

This keyword doesn’t take any test object argument


Input Data


Input Data Required

Description

                         Input Data

This keyword doesn’t take any input data argument.

 


Output Data

  

                         
       Condition

                  Output Value

If the keyword passes successfully

True

If an error is there

False

 



(VI). GetScreenWidth 

This keyword retrieves the width of the Screen at runtime. It does not need any input arguments. 


Example

 

For example, if you want to get the width of the screen at runtime, then here is how you can use this keyword for the same. 


Test Object


Test Object Required?

Description

No

This keyword doesn’t take any test object argument


Input Data


Input Data Required

Description

                         Input Data

This keyword doesn’t take any input data argument.

 


Output Data

  

                         
       Condition

                  Output Value

If the keyword passes successfully

True

If an error is there

False

 

 

(VII). GeSystemIPAddresst 


This keyword retrieves the current IP Address of the system at runtime. It does not need any input arguments. 


Example 


For example, if you want to find your system’s IP Address at runtime, then here is how you can use this keyword for the same. 


Test Object


Test Object Required?

Description

No

This keyword doesn’t take any test object argument


Input Data


Input Data Required

Description

                         Input Data

This keyword doesn’t take any input data argument.

 


Output Data

  

                         
       Condition

                  Output Value

If the keyword passes successfully

True

If an error is there

False

 

 

(VIII).GetValueFromJSON

 

This keyword retrieves the parsed value of JSON. Users need to provide the JSON value and its path as the input parameters. 


NOTE: This keyword can be tested in another way i.e. Rest services of Service Repository. 


Example


GetValueFromJson 

 

JSON 

< Provide JSON value as data input argument> 

JSON Path 

Provide JSON path as data input argument> 


Test Object


Test Object Required?

Description

No

This keyword doesn’t take any test object argument


Input Data


Input Data Required

Description

                        JSON

Provide the JSON value as a data input argument.

 

JSON Path 


    Provide JSON path as data input argument. 



Output Data

  

                         
       Condition

                  Output Value

If the keyword passes successfully

True

If an error is there

False



Error conditions 


Condition 


Message 

Debug Info 

If the user provides a JSON value and doesn’t provide the path. 

Argument Data Missing (-13200) 

Value cannot be Null. 

If the user provides a null Json value and null Json path. 

Argument Data Missing (-13200) 

One or more of the arguments have not been provided a value. 

 

(IX)GetValueFromXpath 


This keyword retrieves the value from the given XML Xpath, i.e. an XML file should have a file path. It takes three input parameters i.e. file path or XML file, Xpath, and delimits by. 


This keyword is mainly used to fetch XPath values from an XML file. Users can input the XML file path or the XML directly in the data input argument, along with the XPath of the desired XML path. 


NOTE 1: DelimitedBy” it’s an optional part and it is used to get two or more than two values from Xpath values can be separated by anything like comma(, ), semi-colon (: ), etc..  


NOTE 2: There is another way to use this keyword i.e. through Service Repository by adding Soap Services. 


Example

GetValueFromXpath 

 

FilePathOrXML  

< Provide FilePathOrXML as data input argument> 

Xpath  

Provide Xpath as data input argument> 

DelimitedBy 

ProvideDelimitedBy as data input argument> 

 

In the above example, if you want to fetch the XPath value then provide this XML and give XPath i.e. “Prompt” and the value is provided in its output in this way he can use this keyword. 


Test Object


Test Object Required?

Description

No

This keyword doesn’t take any test object argument


Input Data


Input Data Required

Description

                        FilePathOrXML 

Provide the FilePathOrXML, Xpath, and DelimitedBy as data input arguments. 

NOTE: The user can also provide the Full XML or file path in the data input argument.

 

X Path 

    

Provide Xpath as data input argument. 

                       DelimitedBy 


Provide DelimitedBy as a data input argument. 

NOTE: As DelimitedBy it is an optional part. 



Output Data

  

                         
       Condition

                  Output Value

If the keyword passes successfully

True

If an error is there

False


Error conditions 


Condition 

Message 

Debug Info 


If the user doesn’t provide FilePathOrXML, Xpath, and DelimitedBy. 


Argument Data Missing (-13200) 


One or more of the arguments have not been provided a value. 



 

3. Global Scope Keywords 

(I). ResetORToOriginal 

 

This keyword goes back to the original Object Repository and neutralizes the effect of previously executed SetOR for all subsequent steps generated after the ResetORtoOriginal keyword. It takes no data input argument. 


Example 

This keyword is mostly used in situations where you want to test multilingual websites. 


Test Object


Test Object Required?

Description

No

This keyword doesn’t take any test object argument


Input Data


Input Data Required

Description

                        No 


This keyword doesn’t take any data input argument. 

 


Output Data

  

                         
       Condition

                  Output Value

When we execute a Test Case having a Test Step (ResetORtoOriginal) 

Pass

 There are no negative scenarios for this keyword.
                              --


Error conditions 


There are no negative Scenarios for this keyword. 

  

(II). RestoreStepTimeOut 


This keyword restores the default step timeout. It is called before setting the step timeout keyword. It does not require any input argument. 


Example: 

If the user wants to restore its default timeout, then use this keyword. 


RestoreStepTimeOut: 

  

Step Timeout 

No input argument required 


NOTE: There are no error conditions for this keyword.


Test Object


Test Object Required?

Description

No

This keyword doesn’t take any test object argument


Input Data


Input Data Required

Description

                        No 


This keyword doesn’t take any data input argument. 

 


Output Data

  

                         
       Condition

                  Output Value

If the keyword passes successfully 

True



(III). SetGlobalVariableValue 

This keyword is used to set the global variable value at runtime. 


NOTE: 

To set a global variable value at runtime, open a browser with your web application's specified URL and use the "SetGlobalVariableValue" keyword, providing the variable name and variable value. 


Example 

If you want to set the Global variable value “Mozilla Firefox” of the Open browser as “Chrome” then use this keyword as shown- SetGlobalVariableValue 


SetGlobalvariablevalue 

VariableName 

Default Browser 

Variable value 

Chrome 


Test Object


Test Object Required?

Description

No

This keyword doesn’t take any test object argument


Input Data


Input Data Required

Description

                        VairableName

Specify the Global variable 

 

VariableValue

    

     Specify the value 


Output Data

  

                         
       Condition

                  Output Value

If the keyword passes successfully

True

If an error is there

False


Error conditions 


Conditions 

Message 

Debug Information 

If the user does not provide Variable Name and Variable Value 

< Argument Data Missing (-13200) > 

GlobalVariableName cannot be blank 

If the user does not provide Variable Value and Variable Name 

< > 

  

If the user does not provide a variable name and variable value 

Argument Data Missing (-13200) 

GlobalVariableName cannot be blank 

 

(IV). SetOR 

 

This keyword tests multilingual websites by dynamically setting an Object Repository (OR) using the specified path. It requires the OR File Path as a data input argument and doesn't take any object input. 


Example 

This keyword is mostly used in situations where you want to test multilingual websites. 


Test Object


Test Object Required?

Description

No

This keyword doesn’t take any test object argument


Input Data


Input Data Required

Description

                  OR File Path

Provide the Path of the object repository file. (For eg.:- OR Folder name File name) 

Note: Object Repository file must be in shared mode.

 


Output Data

  

                         
       Condition

                  Output Value

If the keyword passes successfully

Gives OR Full Name exists 

If an error is there

 OR Full Name doesn’t exist 

  


  

Error conditions 


Scenarios 

Error Message 

Debug Information 

If given OR full name is incorrect  

Argument Data Invalid (-13300) 

Debug Info: OR [setORO.R1] could not be located either it is not shared or Invalid Path. 

OR Full name is blank 

Argument Data Missing (-13200)  

OR full name cannot be blank 

 

(V). SetStepTimeOut 

This keyword dynamically adjusts the timeout for a specific execution or step during runtime. It requires time input in seconds. 

NOTE 

If a user wants to set the step timeout for any particular step or execution then, open any browser (along with the specified URL of your web application) and use the keyword “tepTimeOut”. 


Example: 

If the user wants to set the timeout for a particular step or execution then he can use this keyword and provide the time in seconds. 



SetStepTimeOut 

  

Step Timeout 

Provide value and digit as data input argument 


Test Object


Test Object Required?

Description

No

This keyword doesn’t take any test object argument


Input Data


Input Data Required

Description

                  

Step Timeout 

Provide the step timeout in seconds as a data input argument. 

 


Output Data

  

                         
       Condition

                  Output Value

If the keyword passes successfully

True

If an error is there

 False

 

Error conditions 


Condition 


Message 

Debug Info 

If the user doesn’t provide a step timeout value. 

Argument Data Missing (-13200) 

StepTimeout cannot be blank. 

  

4. Mathematical Operation Keywords 


(I). EvaluateExpression 


This keyword is used to evaluate/calculate the given expression which is provided by the user in the input parameter. With the help of this keyword, users can perform multiple calculations at a time. 


It is mostly used in situations where you need to evaluate your given expression which takes integer values and operators as input argument and then it provides the result in its output. 

NOTE: This keyword does not require any object argument. It only takes integer values and operators to calculate the expression. 


Example

EvaluateExpression 

  

Integer value 

< Provide the Integer value in the data input argument > 

Operators 

< Provide the operator in the data input argument > 


Test Object


Test Object Required?

Description

No

This keyword doesn’t take any test object argument


Input Data


Input Data Required

Description

                  

Integer Value

Provide integer value then operator as data input argument. 

NOTE: Integer values here are referred to as operands. 

 

                           Operator 

     Provide operator value i.e. Addition,         multiplication, etc. 



Output Data

  

                         
       Condition

                  Output Value

If the keyword passes successfully

Evaluated Value 

If an error is there

< Blank > 

 


Error conditions


Condition 

Message 

Debug Info 

Don’t provide integer value and operator. 

Argument Data Missing (-13200) 

System.ArgumentNullException: Value cannot be null. 

Provide integer value then provide operator then again don’t provide integer value. 

Argument Data Missing (-13300) 

System.Data.EvaluateException: Syntax error: Missing operand after '-' operator 

 

(II). GetRandomNumber 


This keyword fetches any random number between the two integers i.e. provides minimum and maximum value in the data input argument. 


NOTE: This keyword does not require any object. It only takes integer values. 


Example: 

If the user wants to fetch any random number between the min i.e. “500” and max i.e. “1000” then he can use this keyword.


GetRandomNumber 

Min value

  500

  Max value   1000


Test Object


Test Object Required?

Description

No

This keyword doesn’t take any test object argument


Input Data


Input Data Required

Description

                  

Min number 

Provide the minimum value in the data input argument. 

 

                           

Max number 

     

Provide the maximum value in the data input argument. 


Output Data

  

                         
       Condition

                  Output Value

If the keyword passes successfully

Any Random Number 

 

If an error is there

                             0 




Error conditions


Condition 

Message 

Debug Info 

Don’t provide min number and max number. 

Argument Data Missing (-13200) 

For random numbers please provide a maximum value greater than 0 

Provide a number greater than the max num 

Argument Data Invalid (-13300) 

'minValue' cannot be greater than maxValue. Parameter name: minValue 

 

(III). RoundOff 


This keyword rounds off the integer value up to the given decimal place which is provided by the user in its input argument. 


NOTE: This keyword does not require any object. It takes integer value (with decimal point) and digit value (up to which decimal place it is to be rounded off) as input argument. 


Example: 

If the user provides the value i.e. “1.56985” and the digit it provides “3” then it will “Roundoff” the value up to 3 decimal places i.e. “1.57” in the output in this way he can use this keyword. 


RoundOff 

Value 

Provide value as data input argument  

  

Digit 

Provide digit as data input argument 

  


Test Object


Test Object Required?

Description

No

This keyword doesn’t take any test object argument


Input Data


Input Data Required

Description

                  

Value  

Provide the value as the input data argument. 

NOTE: Value should be provided in Decimal 

 

                           

Digit 

     

Provide a digit as the input data argument 


Output Data

  

                         
       Condition

                  Output Value

If the keyword passes successfully

Round Off value 

 

 

If an error is there

                             < Blank >


Error conditions


Condition 

Message 

Debug Info 

Don’t provide value and digit. 

Argument Data Missing (-13200) 

One or more of the arguments have not been provided a value 

Provide value i.e. (10.35) and digit i.e. (20) 

Argument Data Invalid (-13300) 

System.ArgumentOutOfRangeException: Rounding digits must be between 0 and 15, inclusive. 

  

5. Process Keywords 


(I). GetStatusOfWindowsService 

 

This keyword checks and returns the status of a specified Windows Service, requiring the Service Name as an input parameter. 

Example:-

If you want to get the status of a window service, here is how you will use this keyword- 

  • Add GetStatusOfWindowService keyword 

  • Run to get the status of your window service 


Test Object


Test Object Required?

Description

No

This keyword doesn’t take any test object argument


Input Data


Input Data Required

Description

                  

Service Name (need not be case sensitive) 

 

Specify the Window Service name 

 


Output Data

  

                         
       Condition

                  Output Value

If service is running at that time 


Running 

 

 

If Service is stopped at that time 

                             

Stopped 

 

 If a wrong service name is provided 


 False

 

Error conditions 


Conditions 

Message 

Debug Info 


Invalid data 


Unsatisfied Dependencies 


The specified service does not exist as an installed service 

Blank data 

Argument Data Invalid 

  

 

(II). GetSystemProperty 

 

This keyword fetches the value of a specified environment variable (User and System) using the variable name as an input parameter. For details on viewing environment variables, visit this link. 


Example 


If you want to get the value of the specified system environment, here is how you will use this keyword- 

  • Add GetSystemProperty keyword 

  • Run to get the status of your window service 


Test Object


Test Object Required?

Description

No

This keyword doesn’t take any test object argument


Input Data


Input Data Required

Description

                  

Variable Name (need not be case sensitive) 

 

Specify the Environment Variable name 

 


Output Data

  

                         
       Condition

                  Output Value

       If the correct name is provided  


Variable value 

 

 

If wrong input is provided  

                             

                   Blank                   

 

              If data input is not provided  

                     False

 

Error conditions 


Conditions 

Message 

Debug Info 

Invalid data 

  

  

Blank data 

Argument Data Invalid 

  


(III). RunCommand 


This keyword executes the given command on the command prompt and provides the result. It takes command as a data input argument. 


Example 

This keyword is mostly used in situations when you want to execute a command on a command prompt. The command provided in the data input argument will be executed. 


Test Object


Test Object Required?

Description

No

This keyword doesn’t take any test object argument


Input Data


Input Data Required

Description

                  

Command

 

Provide the command to be executed on the command prompt 

 


Output Data

  

                         
       Condition

                  Output Value

       

If the keyword passes successfully 


Command executed successfully

If no command is provided

                             

            Error

                  

  

Error conditions 


Scenarios 

Error Message 

Debug Information 

No command provided 

Argument Data Missing (-13200)  

The Command Argument is missing 

  

6. Runtime Keywords 


(I). ResetGenericPluginToDefault 


This keyword, used after a SetGenericPlugin keyword, resets the system to utilize the default generic plugin and does not require any input arguments. 


Example 


This keyword is mostly used in situations where you want to switch to the previous plugin with which execution started. 


Test Object


Test Object Required?

Description

No

This keyword doesn’t take any test object argument


Input Data


Input Data Required?

Description

                  

No

 

This keyword doesn’t take any data input argument. 

Provide the command to be executed on the command prompt 

 


Output Data

  

                         
       Condition

                  Output Value

       

If the keyword passes successfully 


This keyword switches your plugin to the previous plugin with which execution started. 

If an error is there

                             

            False 

                  

 

 

Error conditions 

This keyword never fails. 

 

(II). SetGenericPlugin 


This keyword sets a plugin, different from the chosen plugin at run-wizard to execute the generic keywords. It takes the Plugin as data Input Arguments. 


Example 

If you want to set a plugin “Selenium WebDriver” which is different from what is chosen at run-wizard to execute the generic keywords, you can do so by using the SetGenericPlugin keyword as follows: 


SetGenericPlugin 

  

Plugin Name 

Selenium WebDriver 


Test Object


Test Object Required?

Description

No

This keyword doesn’t take any test object argument


Input Data


Input Data Required?

Description

                  

Plugin Name  

 

Specify the Plugin Name. 

 


Output Data

  

                         
       Condition

                  Output Value

       

If the keyword passes successfully 


True 

If an error is there 

                             

                            False 

                  

 


Error conditions 


Scenarios 

Error Message 

Debug Information 

If an invalid data input argument is provided. 

Plugin Not Loaded (-9902100)  

DESCRIPTION:  

A plugin was not loaded at the execution site. This might happen if the plugin was used in authoring a test but was not installed on the machine where the actual execution took place. Even an installed plugin might fail if its dependencies are not properly installed. 

The plugin 'Selenium WebDriver' is not loaded. Please use a plugin-specific keyword or a custom keyword for this plugin to load the plugin in the runtime. 

If Blank Plugin Name is passed  

Argument Data Missing (-13200)  

DESCRIPTION:  

A step could not be executed because one or more of the arguments have not been provided a value. Of all the arguments a keyword accepts, some arguments might be compulsory. As opposed to the non-compulsory ones, the compulsory argument must be provided some data. The data may be provided through one of many sources like statically entering, the output of a previous step, a global variable, etc; but it must not be left blank. 

The Plugin Name cannot be blank. 

  

7. Service Keywords 

(I). RestartWindowsService 

 

This keyword restarts the specified Windows Service. It takes Servicename and TimeoutInSeconds as data input parameters. 


Example 

 

This keyword is mostly used in situations when you want to restart a particular Windows service.

 

Test Object


Test Object Required?

Description

No

This keyword doesn’t take any test object argument


Input Data


Input Data Required

Description

                  

Service 

Name 

 

This keyword doesn’t take any data input argument. 

 

TimeOut 

In 

seconds 


        Provide the timeout in seconds. 



Output Data

  

                         
       Condition

                  Output Value

       

If the keyword passes successfully 


Windows Service Name & timeout in seconds are given correctly 

 

If an error is there 

                             

Windows Service Name & timeout in seconds are given Incorrectly

 Error conditions 


Scenarios 

Error Message 

Debug Information 

Windows Service Name & timeout in seconds are given Incorrectly 

Unauthorized Access Exception (-18100) 

The specified service does not exist as an installed service. 

Windows Service Name & timeout in seconds are Not given 

Argument Data Invalid (-13300) 

Data not provided. 

 

(II). StartWindowsService 

 

This keyword starts the specified Window Service. For example, your window service is getting stopped during a certain action and you want to get that service started. In this case, you can use this keyword. This keyword takes Service Name and Timeout as input parameters. 

  

*Note - Providing Timeout is not mandatory. 


Example:-


If you want to start a window service, here is how you will use this keyword -  

  • Add StartWindowService keyword 

  • Run to get the start your window service 


Test Object


Test Object Required?

Description

No

This keyword doesn’t take any test object argument


Input Data


Input Data Required

Description

                  

Service Name (need not be case sensitive) 

 

 

Specify the Window Service name 

 

Timeout (in seconds) 

       

        Specify the timeout 


Output Data

  

                         
       Condition

                  Output Value

       

If action is performed successfully 


True 

 

If Access is denied or service is already running 

                             

False 

If a service name is not provided 


Blank 


  

Error conditions 

 

Conditions 

Message 

Debug Info 

Invalid data, Valid timeout 

Argument Data Invalid 

  

Blank data 

Argument Data Invalid 

  

 

(III). StopWindowsService 

 

This keyword stops the specified Windows Service. It takes Servicename and Timeout in Seconds as data input parameters. 


Test Object


Test Object Required?

Description

No

This keyword doesn’t take any test object argument


Input Data


Input Data Required

Description

                  

Service Name

 

 

Specify the Window Service name 

 

Timeout (in seconds) 

       

        Specify the timeout 


Output Data

  

                         
       Condition

                  Output Value

       

If the keyword passes successfully 


Windows Service Name & timeout in seconds are given correctly 

 

If an error is there 

                             

Windows Service Name & timeout in seconds are given Incorrectly 

 

Error conditions 


Conditions

Error Message 

Debug Information 

Windows Service Name & timeout in seconds are given Incorrectly 

Unauthorized Access Exception (-18100) 

The specified service does not exist as an installed service. 

Windows Service Name & timeout in seconds are Not given 

Argument Data Invalid (-13300) 

Data not provided. 

  

8. String Function Keywords 


(I). CountOfSubString 

 

This keyword counts the number of substrings present in the main string. You must provide the main string from which you want to count the substring. 


Example 


If you want to get the count of the string from the main string, here is how you will use this keyword- 


  • Add CountOfSubString keyword 

  • Type or Paste your Main String in the MainString data 

  • Type your SubString data, i.e, the substring that you want to count from MainString 

  • Select your IgnoreCase – True, if you want to count, say, alphabets irrespective of case sensitivity, and False, if you want to count Substrings that exactly match from Main String  


Test Object


Test Object Required?

Description

No

This keyword doesn’t take any test object argument


Input Data


Input Data Required

Description

                  

MainString 

 

 

Specify the main string from which the string needs to be counted 

 

SubString 

       

        

Specify the sub-string that needs to be counted 

Specify the sub-string that needs to be counted 

IgnoreCase 


Select the Ignore Case 



Output Data

  

                         
       Condition

                  Output Value

       

If the keyword is passed successfully


Returns the number of strings specified from the main string 

 

When the argument has not been provided with a value 

                             

0

 



Error conditions 


Conditions 

Message 

Debug Info 

Blank Main String 

Argument Data Missing 

One or more of the arguments have not been provided a value 

Blank Sub String 

Argument Data Missing 

One or more of the arguments have not been provided a value 

 

(II). GetCurrentTimeZone 

 

This keyword is used to get the current timezone. It takes no input argument. 


Example 

 

This keyword is mostly used in situations where you want to know the current time zone of the local system.


Test Object


Test Object Required?

Description

No

This keyword doesn’t take any test object argument


Input Data


Input Data Required?

Description

                 

No

 

This keyword doesn’t take any data input argument. 

 


Output Data

  

                         
       Condition

                  Output Value

       

If the keyword is passed successfully


This keyword provides the current time zone of the system on which execution is going on. 

 

 

Error conditions 


This keyword never fails. 

 

(III). GetStringLength 


This keyword gets the length of the string. It is mostly used in situations where you want to acquire the provided String Length. 


For example, you want to get the String Length. 

 

Example 

If you want to return a True Output 

String 

Automation 

  

Output 

<10> 

Note: If the user provides only space or integer value then it will show the count in output. 


Test Object


Test Object Required?

Description

No

This keyword doesn’t take any test object argument


Input Data


Input Data Required

Description

                 

String 

 

This Keyword takes value in text in string format  

 


Output Data

  

                         
       Condition

                  Output Value

       

If the keyword is passed successfully


It gives the number of text which is provided in string length 

 

  If an error is there. 


  False

 

 Error conditions 


Condition 

Debug Information 

Message 

If the String Value is null 

One or more of the arguments have not been provided a value 

Argument Data Missing (-13200)  

DESCRIPTION:  

A step could not be executed because one or more of the arguments have not been provided a value. Of all the arguments a keyword accepts, some arguments might be compulsory. As opposed to the non-compulsory ones, the compulsory argument must be provided some data. The data may be provided through one of many sources like statically entering, the output of a previous step, a global variable, etc; but it must not be left blank. 

 

(IV). IndexOf 


This keyword fetches the index of the substring from the main string. It is mostly used in situations where you want to retrieve the index of a substring from the main string. 


For example, you want to fetch the substring index 


Example 

If you want to return a True Output 

String 

< automation >  

Sub-String 

< t > 

Output 

< 2 > 


Test Object


Test Object Required?

Description

No

This keyword doesn’t take any test object argument


Input Data


Input Data Required

Description

                 

String 

 

This Keyword takes value in text in string format  

 

Sub-String 


       This Keyword takes value in text               present in the string  



Output Data

  

                         
       Condition

                  Output Value

       

If the keyword is passed successfully


It gives the value of the index which is provided in the string 

 

  If an error is there. 

  False



Error conditions 


Conditions

Error Message 

Debug Information 

If the String Value is null 

Argument Data Missing (-13200) 

DESCRIPTION:  

A step could not be executed because one or more of the arguments have not been provided a value. Of all the arguments a keyword accepts, some arguments might be compulsory. As opposed to the non-compulsory ones, the compulsory argument must be provided some data. The data may be provided through one of many sources like statically entering, the output of a previous step, a global variable, etc; but it must not be left blank. 

One or more of the arguments have not been provided a value 

If String Value is null but Sub-String Value is not null 

Argument Data Invalid (-13300) 

Data not provided. 


 

(V). IsBoolean 


This keyword verifies whether the specified value is Boolean or not. It returns true if the specified string is Boolean. It takes the String value as the data input argument. 

For example, you want to return true. 


Example 

If you want to return a Boolean Value 

String 

Boolean Value 

Output 

                                     True 

  


Test Object


Test Object Required?

Description

No

This keyword doesn’t take any test object argument


Input Data


Input Data Required

Description

                 

String 

 

This Keyword takes value in String. 

Note: Value should be in True/False text 

 


Output Data

  

                         
       Condition

                  Output Value

       

If the keyword is passed successfully


True 

 

  

 If an error is there


  False



 

Error conditions 



Conditions

Error Message 

Debug Information 

If the String Value is null 

Argument Data Missing (-13200)  

DESCRIPTION:  

A step can't proceed without values for mandatory arguments. Unlike optional ones, compulsory arguments must be filled with data, which can come from a static entry, a previous step's output, or a global variable. Leaving them empty is not allowed.

The string1 argument is missing 

 

 

(VI). IsDouble 


This keyword verifies whether the specified string value is double or not. It returns true if the specified string is double. This keyword is mostly used in situations where you want to take double output in step output. 


For example, you want to take double the value of a particular integer string. 


Example 

If you want to return a True Output 

String 

<123456789> 

Output 

  


Test Object


Test Object Required?

Description

No

This keyword doesn’t take any test object argument


Input Data


Input Data Required

Description

                 

String 

 

This Keyword takes value in the String  

Note: Value should be in integer form for True Result. 

 


Output Data

  

                         
       Condition

                  Output Value

       

If the keyword is passed successfully


True 

 

  

 If an error is there


  False


Error conditions 



Conditions

Error Message 

Debug Information 

If the String Value is null 

Argument Data Missing (-13200)  

DESCRIPTION:  

A step can't proceed without values for mandatory arguments. Unlike optional ones, compulsory arguments must be filled with data, which can come from a static entry, a previous step's output, or a global variable. Leaving them empty is not allowed. 

The string1 argument is missing 


(VII). IsInteger 


This keyword verifies whether the specified value is an Integer or not. It checks and returns true if the specified string is an integer. This keyword is mostly used in situations where you want to check whether the specified string is an integer or not. 


For example, you want to return true. 


Example 

If you want to return a True Output 

String 

<123456789> 

Output 

True 

  


Test Object


Test Object Required?

Description

No

This keyword doesn’t take any test object argument


Input Data


Input Data Required

Description

                 

String 

 

This Keyword takes value in String. 

Note: Value should be in integer form for True Result. 

 


Output Data

  

                         
       Condition

                  Output Value

       

If the keyword is passed successfully


True 

 

  

 If an error is there


  False


Error conditions 



Conditions

Error Message 

Debug Information 

If the String Value is null 

Argument Data Missing (-13200)  

DESCRIPTION:  

A step can't proceed without values for mandatory arguments. Unlike optional ones, compulsory arguments must be filled with data, which can come from a static entry, a previous step's output, or a global variable. Leaving them empty is not allowed. 

The string1 argument is missing 


Click here to go through the fifth list of system keywords in Opkey.



Click Here to learn more about Opkey features.

To learn more about using these keywords in a test case, you can visit https://university.opkeylms.com and enroll in our Opkey series course.



 

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article