This keyword sends keystrokes to the active application window. It takes Key and No. of repetition as the input parameter.
Test Object
Input Data
| |
| 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 | |
| |
Example
If you want to press a key, here is how you will use this keyword
Error conditions
| | |
| Argument data missing (-13200) | One or more of the arguments have not been provided a value |
2. KillProcess
This keyword kills or stops a specified Process. It takes the process name that you want to stop (eg. notepad.exe) as the input parameter.
Test Object
Input Data
| |
| Name of the process you want to kill in string format |
Output Data Value
Condition | Output Value |
If the keyword passes successfully | |
| |
Example
If you want to kill the process, here is how you can use this keyword
Error conditions
| | |
| 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
Input Data
| |
| 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 | |
| |
Example
If you want to send a key name (in string format), here is how you can use this keyword
Error conditions
| | |
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
Input Data
| |
| 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 | |
| |
Example
If you want to compare the two strings, this is how you will use this keyword.
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
Input Data
| |
| This value is provided in operand 1 |
Operand2 | This value is provided in operand 2 |
Output Data Value
Example
If you want to verify that both the operands' values are equal or not, you can use this keyword in the following way.
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 Operand1 & Operand2 as input parameters.
Test Object
Input Data
| |
| 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 | |
If the first value is less than or equal to the second | |
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.
7. IsNotEqual
This keyword verifies whether the specified Operands are not equal. It returns true if the given strings are not equal. It takes Operand1 & Operand2 as input parameters.
Test Object
Input Data
| |
| 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 | |
If the first value is equal to the second | |
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.
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
Input Data
| |
| 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 | |
If the first value is more than or equal to the second | |
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.
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
Input Data
| |
| 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 | |
If the second string is not part of the first string | |
Example
If you want to verify that the substring is part of a string or not, here is how you will use this keyword.
| Selenium is a Test Automation tool |
| |
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
| |
| This keyword doesn’t take any object input argument. |
Input Data
| |
| Specify the Value returned from the Procedure. |
| Specify the Procedure Name. |
| Specify the Name of the parameter |
| Specify the Value of the parameter |
Output Data Value
Condition | Output Value |
If the keyword passes successfully | |
| |
Example
To validate the returned value in the result after executing a procedure, utilize the VerifyValueInProcedure keyword as follows:
Common Error conditions
| | |
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. | |
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
| |
| This keyword doesn’t take any object input argument. |
Input Data
| |
| Specify the value to be verified. |
| Specify the database query. |
Output Data Value
Condition | Output Value |
If the keyword passes successfully | |
| |
Example
If you want to validate the value in the Record Set, you can do so by using the VerifyValueInRecordSet keyword as follows:
| |
| select * from main_settings; |
Common Error conditions
| | |
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
| |
| This keyword doesn’t take any object input argument. |
Input Data
| |
| Give the string value that needs to be copied |
Output Data Value
Condition | Output Value |
If the keyword passes successfully | |
| |
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
| | |
If no value is given in Data Input Arguments | | 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
| |
| This keyword doesn’t take any object input argument. |
Input Data
| |
| Give the valid values (can be String, Integer, Boolean, or Double) |
Output Data Value
Condition | Output Value |
If the keyword passes successfully | |
| |
Error conditions
| | |
If invalid values are provided | | 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
| |
| This keyword doesn’t take any object input argument. |
Input Data
| |
| 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 |
| |
Error conditions
| | |
If invalid values are provided | | 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
| |
| This keyword doesn’t take any object input argument. |
Input Data
| |
| 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 |
| |
Error conditions
| | |
If invalid values are provided | | 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
| |
| This keyword doesn’t take any object input argument. |
Input Data
| |
| 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 | |
| |
Error conditions
| | |
If invalid values are provided | | 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
| |
| This keyword doesn’t take any object input argument. |
Input Data
Output Data Value
Condition | Output Value |
If the keyword passes successfully | Input value converted to string format |
| |
Note: No 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
| |
| This keyword doesn’t take any object input argument. |
Input Data
| |
| 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 | |
| |
Example
If you want to connect to a database, you can do so by using the ConnectDataBase keyword as follows:
| < Specify the Driver Name > Here, MySQL |
| server=localhost;uid=root;pwd=root; database= my database; < Here, Database Name= my database > |
Common Error conditions
| | |
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. | |
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
| |
| This keyword doesn’t take any object input argument. |
Input Data
| |
| This keyword doesn't require data input argument |
Output Data Value
Condition | Output Value |
If the keyword passes successfully | |
| |
Common Error conditions
| | |
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.