List of Keywords - System Keywords 1


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 first list of system keywords and their utility.

 
1. KeyPress 


This keyword sends keystrokes to the active application window It takes Key and No. of repetition as the input parameter. 

 

 

Test Object

  

Object Input Required

Description

Not required 

Not required 

 
Input Data

Data Input Required

Description 

Key

Name of the key in string format

Note: Please provide the String name in Curly Braces.

 

Output Data Value

  

Condition
Output Value

If the keyword passes successfully 

True

If there is an error

False 


Example 


If you want to press a key, here is how you will use this keyword 

 

Key 

{ENTER} 

Output 

True 

  

Error conditions 

  

Condition 

Debug Information 

Message 

If the key value is null 

Argument data missing (-13200) 

 
 

 

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

 

2. KillProcess 


This keyword kills or stops specified Process. It takes the process name that you want to stop (eg. notepad.exe) as the input parameter. 

Test Object

  

Object Input Required

Description

Not required 

Not required 

 
Input Data

Data Input Required

Description 

Process name

Name of the process you want to kill in string format

 

Output Data Value

  

Condition
Output Value

If the keyword passes successfully 

True

If there is an error

False 


Example


If you want to kill the process, here is how you can use this keyword 


Process Name 

notepad.exe 

Output 

True 


Error conditions 


Condition 

Debug Information 

Message 

If Process 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. 

 

 

Process names cannot be blank. 

 

3. SendString 


This keyword sends a string to the active application window. It takes KeyName as an input parameter. 

Test Object

  

Object Input Required

Description

Not required 

Not required 

 
Input Data

Data Input Required

Description 

KeyName

Name of the key in string format

Note: Please provide the String name in Curly Braces. 

 

Output Data Value

  

Condition
Output Value

If the keyword passes successfully 

True

If there is an error

False 


Example

If you want to send a key name (in string format), here is how you can use this keyword 

 

  

KeyName 

{ENTER} 

Output 

True 

  

  

Error conditions 

  

Condition 

Debug Information 

Message 

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. 

 
 

 

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

 


4. CompareString 

This keyword compares the two strings whether they are equal or not.  It returns True if the two strings are equal. It takes String1 & String2 as input parameters for comparison. 


Test Object

  

Object Input Required

Description

Not required 

Not required 

 
Input Data

Data Input Required

Description 

String1

This value is provided in operand 1 

String2

This value is provided in operand 2

IgnoreCase
This value is provided to ensure that the character case of strings is ignored while comparing

 

Output Data Value

  

Condition
Output Value

If the strings match successfully 

True

If strings do not match

False 


Example

If you want to compare the two strings, this is how you will use this keyword. 

 

  

String1 

<18> 

String2 

<18> 

  

5. IsEqual 


This keyword verifies whether the two given input values are equal or not. It returns True if the two given values are equal. It takes Operand1 & Operand2 as input parameters. 

Test Object

  

Object Input Required

Description

Not required 

Not required 

 
Input Data

Data Input Required

Description 

Operand1

This value is provided in operand 1 

Operand2

This value is provided in operand 2

 

Output Data Value

  

Condition
Output Value

If the values are equal 

True

If values are not equal

False 


Example


If you want to verify that both the operands' values are equal or not, you can use this keyword in the following way.

  

Operand1 

<18> 

Operand2 

<18> 

 

6. IsGreater 


This keyword verifies whether the First operand value is greater than the second. It returns True if the first specified integer value is greater than the second one. It takes Operand& Operand2 as input parameters. 


Test Object

  

Object Input Required

Description

Not required 

Not required 

 
Input Data

Data Input Required

Description 

Operand1

This value is provided in operand 1 

Operand2

This value is provided in operand 2

IgnoreCase
This value is provided to ensure that the character case of strings is ignored while comparing

 

Output Data Value

  

Condition
Output Value

If the first value is greater than the second 

True

If the first value is less than or equal to the second

False 


Example


If you want to verify that the first operand value is greater than the second one, here is how you will use this keyword. 

  

Operand1 

<18> 

Operand2 

<16> 

 


7. IsNotEqual 


This keyword verifies whether the specified Operands are not equal. It returns true if the given strings are not equal. It takes Operand& Operand2 as input parameters. 

Test Object

  

Object Input Required

Description

Not required 

Not required 

 
Input Data

Data Input Required

Description 

Operand1

This value is provided in operand 1 

Operand2

This value is provided in operand 2

 

Output Data Value

  

Condition
Output Value

If the first value is not equal to the second 

True

If the first value is equal to the second

False 


Example


If you want to verify that the first operand value is not equal to the second operand value, here is how you can use this keyword.  

 

Operand1 

<8> 

Operand2 

<11> 

 

8. IsSmaller 


This keyword verifies whether the first-string value is smaller than the second one or not. It is mostly used in situations where you want to verify that the first value present in the string is smaller or not. 

Test Object

  

Object Input Required

Description

Not required 

Not required 

 
Input Data

Data Input Required

Description 

Operand1

This value is provided in operand 1 

Operand2

This value is provided in operand 2

 

Output Data Value

  

Condition
Output Value

If the first value is smaller than the second 

True

If the first value is more than or equal to the second

False 


Example


If you want to verify that the first operand is smaller as compared to the second one, here is how you will use this keyword. 

 

Operand1 

<8> 

Operand2 

<11> 

 

9. StringContains 


This keyword verifies the sub-string from a specified string. It is mostly used in situations where you want to verify whether the substring is part of a string or not. 

Test Object

  

Object Input Required

Description

Not required 

Not required 

 
Input Data

Data Input Required

Description 

String1

This value is provided in string format for the first string 

String2

This value is provided in string format for the second string 

 

Output Data Value

  

Condition
Output Value

If the second string is part of the first string

True

If the second string is not part of the first string

False 


Example


If you want to verify that the substring is part of a string or not, here is how you will use this keyword. 

  

String1 

  

Selenium is a Test Automation tool

  

String2 

Automation 

  

 

10. VerifyValueInProcedure 


This keyword validates the value returned in the result when a procedure is executed. It takes Value, Procedure Name, Parameter Name, and Parameter Value as data input arguments. 

 

Test object 


Object Input Required 

Description 

Not required 

This keyword doesn’t take any object input argument. 


Input Data

Data Input Required 

Description 

Value 

Specify the Value returned from the Procedure. 

Procedure Name 

Specify the Procedure Name. 

Parameter Name 

Specify the Name of the parameter 

Parameter Value 

Specify the Value of the parameter 


Output Data Value


Condition
Output Value

If the keyword passes successfully

True 

If there is an error

False

 

Example

To validate the returned value in the result after executing a procedure, utilize the VerifyValueInProcedure keyword as follows:  

 

Value  

1000000130 

Procedure Name 

Proc 

Parameter Name  

@input1 

Parameter Value 

SchemaVersion 

 

Common Error conditions 

 

Scenarios 

Error Message 

Debug Information 

If no Data Input Argument is provided  

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 been provided a value. 

When Invalid Data Input Arguments are provided 

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. 

Data Not Provided 

 

11. VerifyValueInRecordSet 

 

This keyword matches the specified value with the actual value available in the database. It takes a value and database query as data input arguments. 


Test object 


Object Input Required 

Description 

Not required 

This keyword doesn’t take any object input argument. 


Input Data

Data Input Required 

Description 

Value 

Specify the value to be verified. 

Query 

Specify the database query. 


Output Data Value


Condition
Output Value

If the keyword passes successfully

True 

If there is an error

False

 

Example

 

If you want to validate the value in the Record Set, you can do so by using the VerifyValueInRecordSet keyword as follows: 

  

Value 

49 

  

Query 

select * from main_settings; 

  

 

Common Error conditions
 

Scenarios 

Error Message 

Debug Information 

When invalid input data is provided. 

Eg. Value: 4 5464 

Unable to verify value no- 45564 record found  

  

When Blank Data Input Arguments are passed 

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. 

  

 


12. CopyToClipBoard

 

This keyword copies data to the clipboard. It takes CopyString as the input parameter. It is mostly used in situations where you want to copy some data and paste it to a text file (for example: notepad, word, etc). 

Test object 


Object Input Required 

Description 

Not required 

This keyword doesn’t take any object input argument. 


Input Data

Data Input Required 

Description 

CopyString

Give the string value that needs to be copied


Output Data Value


Condition
Output Value

If the keyword passes successfully

True 

If there is an error

False

 

Example


Use this keyword to provide a value in CopyString, and then execute it. Open a text editor like Notepad or Word. Paste to see the string from the data input argument of the keyword. 


Error conditions 

  

Condition 

Message 

Debug Info 

If no value is given in Data Input Arguments 

Argument Data Missing 

The copy argument string is missing 

  


13. ConvertToBoolean 


This keyword converts the input value to a boolean. It takes the input value as the input parameter. It is used in situations where you want to convert value into Boolean. 


Test object 


Object Input Required 

Description 

Not required 

This keyword doesn’t take any object input argument. 


Input Data

Data Input Required 

Description 

Value

Give the valid values (can be String, Integer, Boolean, or Double) 


Output Data Value


Condition
Output Value

If the keyword passes successfully

True 

If there is an error

False

 



Error conditions 

Condition 

Message 

Debug Info 

If  invalid values are provided 

Argument Data Invalid 

Conversion from string "hello123.235uyrt^&%^&" to type 'Boolean' is not valid. 

 

14. ConvertToDateTime 


This keyword converts the string of specified format to DateTime format. It takes SourceString & SourceFormat as input parameters. 


Test object 


Object Input Required 

Description 

Not required 

This keyword doesn’t take any object input argument. 


Input Data

Data Input Required 

Description 

SourceString

Give a string containing the date as input. 

SourceFormat

The format used in the source string (eg dd/mm/yy).


Output Data Value


Condition
Output Value

If the keyword passes successfully

Input string in DateTime format 

If there is an error

No value

 


Error conditions 

Condition 

Message 

Debug Info 

If invalid values are provided 

Argument Data Invalid 

The string was not recognized as a valid DateTime. 

 

15. ConvertToDouble 


This keyword converts the Input value to double. It takes input value and precision as input parameters. It is used in situations where you want to convert the value in double, ie. in decimal format. 

Test object 


Object Input Required 

Description 

Not required 

This keyword doesn’t take any object input argument. 


Input Data

Data Input Required 

Description 

Input Value

Specify the integer value. 

Precision

Specify the number of fractional digits in the return value.


Output Data Value


Condition
Output Value

If the keyword passes successfully

Input string converted to double 

If there is an error

No value

 


Error conditions 


Condition 

Message 

Debug Info 

If  invalid values are provided 

Argument Data Invalid 

Conversion from string "hello. mnnb" to type 'Double' is not valid. 

 

16. ConvertToInteger 


This keyword converts the input value to an integer. It takes input value & RoundOff as input parameters. It is mostly used in situations where you want to convert a value to an Integer. 

Test object 


Object Input Required 

Description 

Not required 

This keyword doesn’t take any object input argument. 


Input Data

Data Input Required 

Description 

Input Value

Specify the integer value. 

Roundoff

Specify whether to round off the input value or not.


Output Data Value


Condition
Output Value

If the keyword passes successfully

Rounded off input value 

If there is an error

No value



Error conditions 

Condition 

Message 

Debug Info 

If  invalid values are provided 

Argument Data Invalid 

Conversion from string "hello" to type 'Integer' is not valid. 

 

17. ConvertToString 


This keyword converts an input value to a string datatype. It takes a value of a different datatype as an input parameter. It is used in situations where you want to convert a value to a string. 

Test object 


Object Input Required 

Description 

Not required 

This keyword doesn’t take any object input argument. 


Input Data

Data Input Required 

Description 

Input Value

Specify the input value. 


Output Data Value


Condition
Output Value

If the keyword passes successfully

Input value converted to string format 

If there is an error

No value



NoteNo error condition is available for this keyword. 


18. ConnectDatabase 


This keyword enables connection with a database. It takes the database driver name and connection string as data input arguments.

Test object 


Object Input Required 

Description 

Not required 

This keyword doesn’t take any object input argument. 


Input Data

Data Input Required 

Description 

Driver Name

Specify the Driver Name. 

Example: 

MySQL:- MySQL 

Oracle:- Oracle 

SQLSERVER: System.Data.SQlClient 

SQLite : Sqlite 

 

ConnectionString

Specify the Connection String required to connect to the database.


Output Data Value


Condition
Output Value

If the keyword passes successfully

True

If there is an error

False

 

Example 


If you want to connect to a database, you can do so by using the ConnectDataBase keyword as follows: 

  

Driver

< Specify the Driver Name  > Here,  MySQL 

Connection String  

server=localhost;uid=root;pwd=root; 

database= 

my database; < Here, Database Name= my database > 

  

 

Common Error conditions 

Scenarios 

Error Message 

Debug Information 

When Invalid data arguments are provided. 

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. 

Data Not Provided 

When no data input arguments are provided 

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. 

  

 

20. DisconnectDatabase 

 

This keyword is useful in disconnecting from a database. It does not take any input arguments. Before using the Disconnect DataBase keyword, it is mandatory to successfully connect to the DataBase. 

Test object 


Object Input Required 

Description 

Not required 

This keyword doesn’t take any object input argument. 


Input Data

Data Input Required 

Description 

Not required

This keyword doesn't require data input argument 


Output Data Value


Condition
Output Value

If the keyword passes successfully

True

If there is an error

False

 


Common Error conditions 

Scenarios 

Error Message 

Debug Information 

When DataBase has never been connected 

Unsatisfied Dependencies (-14200)  

DESCRIPTION:  

Some dependency was required but could not be located or loaded. Mostly the dependencies are binaries in form of jar/exe/dll, but others are also possible. They could be network resources like databases, DCOM servers, RMI targets, web services etc. 

Currently, the connection with DataBase is not present 

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


To learn more on how you can use these keywords in test scenarios, 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