To learn how to use Collection Keywords in Opkey, you can read Using Collection Keywords - New UI and Using Collection Keywords - Opkey Classic. Now, let's review the first list of Collection keywords and their utility.
Now let's review the list of various collection keywords to understand their utility.
List of Keywords
1. AddItemInKeyValuePairCollection
This keyword adds a corresponding item in KeyValuePairCollection. It takes KeyValuePairCollection Data & items to be added as data input arguments.
Input Arguments
Object Input Arguments | Required? | Description |
Object | No | This keyword doesn’t take any object input argument. |
Data Input Arguments | Required? | Description |
Items | Yes | This keyword takes KeyValuePairCollection Data & item to be added as data input arguments as data input arguments. Note: You can provide Collection Data from Global Variables or static data locally. |
Output
True | This keyword Passes if the given item is added to the KeyValuePairCollection successfully. |
Example
If you want to add
Item : {
"Key": "3",
"Value": "rollno"
}
to the item in KeyValuePairCollection (Data)
Data : [
{
"Key": "1",
"Value": "class"
},
{
"Key": "2",
"Value": "sec"
}
]
then you need to use the AddItemInKeyValuePairCollection keyword. The output will be
[
{
"Key": "1",
"Value": "class"
},
{
"Key": "2",
"Value": "sec"
},
{
"Key": "3",
"Value": "rollno"
}
]
Common Error conditions
This keyword fails in the following common error scenarios as given below -
Condition | Debug Information | Message |
If No data are given | One or more of the arguments have not been provided a value | Argument Data Missing (-13200) DESCRIPTION: |
If the Item to be added is not given | One or more of the arguments have not been provided a value | Argument Data Missing (-13200) DESCRIPTION: A step might fail if it lacks values for required arguments. While certain arguments are optional, mandatory ones must be supplied with data. This data can be entered statically, derived from a prior step's output, sourced from a global variable, etc. It should not be left blank to ensure proper execution. |
2. CheckDuplicacyInCollection
This keyword checks the duplicity in the given Collection. It takes Collection Data as data input arguments.
Input Arguments
Object Input Arguments | Required? | Description |
Object | No | This keyword doesn’t take any object input argument. |
Data Input Arguments | Required? | Description |
Items | Yes | This keyword takes Collection Data as data input argument. Note: You can provide Collection Data from Global Variables or static data locally. |
Output
True | This keyword Passes if it finds duplicity in the specified Collection Data. It returns output as False if No duplicity is found in the Collection. |
Example
If you want to find out duplicity in
Data : [
"asd",
"asd",
"asd",
"asd"
]
then use the keyword CheckDuplicacyInCollection keyword. The output will be True.
Common Error conditions
This keyword fails in the following common error scenarios as given below -
Condition | Debug Information | Message |
If No data are given | One or more of the arguments have not been provided a value | Argument Data Missing (-13200) DESCRIPTION: A step might fail if it lacks values for required arguments. While certain arguments are optional, mandatory ones must be supplied with data. This data can be entered statically, derived from a prior step's output, sourced from a global variable, etc. It should not be left blank to ensure proper execution. |
3. CheckDuplicacyInKeyValuePairCollection
This keyword checks the duplicity in the given KeyValuePairCollection. It takes KeyValuePairCollection Data as data input arguments.
Input Arguments
Object Input Arguments | Required? | Description |
Object | No | This keyword doesn’t take any object input argument. |
Data Input Arguments | Required? | Description |
Items | Yes | This keyword takes KeyValueCollection Data as the data input argument. Note: You can provide KeyValuePairCollection Data from Global Variable or static data locally. |
Output
True | This keyword Passes if it finds duplicacy in the specified KeyValuePairCollection Data. It returns the output as False if No duplicacy is found in KeyValuePairCollection. |
Example
If you want to find out duplicacy in KeyValuePairCollection Data
Data : [
{
"Key": "class",
"Value": "1"
},
{
"Key": "rollno",
"Value": "20"
},
{
"Key": "reg",
"Value": "40"
},
{
"Key": "rollno",
"Value": "20"
}
]
then you need to use the CheckDuplicacyInKeyValuePairCollection keyword. The output will be True.
Common Error conditions
This keyword fails in the following common error scenarios as given below -
Condition | Debug Information | Message |
If No data are given | One or more of the arguments have not been provided a value | Argument Data Missing (-13200) DESCRIPTION: A step might fail if it lacks values for required arguments. While certain arguments are optional, mandatory ones must be supplied with data. This data can be entered statically, derived from a prior step's output, sourced from a global variable, etc. It should not be left blank to ensure proper execution. |
4. GetCollectionOfDelimetedString
This keyword gets the Collection of String with no delimiter. It takes Collection Data & Delimiter as data input arguments.
Input Arguments
Object Input Arguments | Required? | Description |
Object | No | This keyword doesn’t take any object input argument. |
Data Input Arguments | Required? | Description |
Items | Yes | This keyword takes Collection Data & Delimiter as data input arguments. Note: You can provide Collection Data from Global Variables or static data locally. |
Output
True | This keyword Passes if gets Collection data while removing the delimiter from the string Collection. |
Example
If you want to get the Collection by removing the delimiter (comma) from the Apple, Carrot, Mango, Banana
Common Error conditions
This keyword fails in the following common error scenarios as given below -
Condition | Debug Information | Message |
If No data are given | 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, output of a previous step, a global variable, etc; but it must not be left blank. |
5. GetItemFromCollection
This keyword gets a particular item from the given Collection. It takes the Collection Data & index of the item existing in the Collection Data, as as data input arguments.
Input Arguments
Object Input Arguments | Required? | Description |
Object | No | This keyword doesn’t take any object input argument. |
Data Input Arguments | Required? | Description |
Items | Yes | This keyword takes Collection Data & index of the item existing in the Collection Data, as as data input arguments. Note: You can provide Collection Data from Global Variables or static data locally. |
Output
True | This keyword Passes if it gets the specified indexed item from Collection data. |
Example
If you want to get the data existing at index 1 from Collection Data
: [
"a",
"b",
"c"
]
then you need to use the GetItemFromCollection keyword. The output will be b.
Common Error conditions
This keyword fails in the following common error scenarios as given below -
Condition | Debug Information | Message |
If Collection Data is Valid but the given Index is Invalid | Index out of range | Index out of range (-20400) DESCRIPTION: A step could not be executed because the index is greater or equal to the collection items limit. |
If No Collection Data is given but the Index is given | One or more of the arguments have not been provided a value. The collection data is empty | Argument Data Missing (-13200) DESCRIPTION: A step might fail if it lacks values for required arguments. While certain arguments are optional, mandatory ones must be supplied with data. This data can be entered statically, derived from a prior step's output, sourced from a global variable, etc. It should not be left blank to ensure proper execution. |
6. GetItemFromKeyValuePairCollection
This keyword gets a particular item from the given KeyValuePairCollection. It takes KeyValuePairCollection Data & index of the item existing in the KeyValuePairCollection Data, as as data input arguments.
Input Arguments
Object Input Arguments | Required? | Description |
Object | No | This keyword doesn’t take any object input argument. |
Data Input Arguments | Required? | Description |
Items | Yes | This keyword takes KeyValuePairCollection Data & index of the item existing in the Collection Data, as as data input arguments. Note: You can provide Collection Data from Global Variables, Step Output, or static data locally. |
Output
True | This keyword Passes if it gets the specified indexed item from the given KeyValuePairCollection data. |
Example
If you want to get the data existing at index 1 from KeyValuePairCollection Data
Data : [
{
"Key": "class",
"Value": "10"
},
{
"Key": "rollno",
"Value": "12"
}
]
then you need to use GetItemFromKeyValuePairCollection keyword. The output will be
{
"Key": "rollno",
"Value": "12"
}
.
Common Error conditions
This keyword fails in the following common error scenarios as given below -
Condition | Debug Information | Message |
If Collection Data is Valid but the given Index is Invalid | Index out of range | Index out of range (-20400) DESCRIPTION: A step could not be executed because the index is greater or equal to the collection items limit. |
If No Collection Data is given but the Index is given | One or more of the arguments have not been provided a value. The collection data is empty | Argument Data Missing (-13200) DESCRIPTION: A step might fail if it lacks values for required arguments. While certain arguments are optional, mandatory ones must be supplied with data. This data can be entered statically, derived from a prior step's output, sourced from a global variable, etc. It should not be left blank to ensure proper execution. |
7. GetSizeOfCollection
This keyword gets the size of the specified Collection. It takes Collection Data as data input arguments.
Input Arguments
Object Input Arguments | Required? | Description |
Object | No | This keyword doesn’t take any object input argument. |
Data Input Arguments | Required? | Description |
Items | Yes | This keyword takes Collection Data as data input arguments. Note: You can provide Collection Data from Global Variables, Step Output, or static data locally. |
Output
True | This keyword Passes if it gets the specified indexed item from the given KeyValuePairCollection data. |
Example
If you want to get the data existing at index 1 from KeyValuePairCollection Data
Data : [
{
"Key": "class",
"Value": "10"
},
{
"Key": "rollno",
"Value": "12"
}
]
then you need to use the GetItemFromKeyValuePairCollection keyword. The output will be
{
"Key": "rollno",
"Value": "12"
}
.
Common Error conditions
This keyword fails in the following common error scenarios as given below -
Condition | Debug Information | Message |
If Collection Data is Valid but the given Index is Invalid | Index out of range | Index out of range (-20400) DESCRIPTION: A step could not be executed because the index is greater or equal to the collection items limit. |
If No Collection Data is given but the Index is given | One or more of the arguments have not been provided a value. The collection data is empty | 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. |
8. GetSizeOfKeyValuePairCollection
This keyword gets the size of the specified KeyValuePairCollection. It takes KeyValuePairCollection Data as data input arguments.
Input Arguments
Object Input Arguments | Required? | Description |
Object | No | This keyword doesn’t take any object input argument. |
Data Input Arguments | Required? | Description |
Data | Yes | This keyword takes KeyValuePairCollection Data as data input arguments. Note: You can provide KeyValuePairCollection Data from Global Variable or static data locally. |
Output
True | This keyword Passes if it gets the size of the specified KeyValuePairCollection Data. |
Example
If you want to get the size of the KeyvaluePairCollection Data
Data : [
{
"Key": "a",
"Value": "1"
},
{
"Key": "b",
"Value": "2"
},
{
"Key": "c",
"Value": "3"
}
]
then use the keyword GetSizeOfKeyValuePairCollection keyword. The output will be 3.
Common Error conditions
This keyword fails in the following common error scenarios as given below -
Condition | Debug Information | Message |
If No Collection Data is given but the Index is given | One or more of the arguments have not been provided a value. The collection data is empty | Argument Data Missing (-13200) DESCRIPTION: A step might fail if it lacks values for required arguments. While certain arguments are optional, mandatory ones must be supplied with data. This data can be entered statically, derived from a prior step's output, sourced from a global variable, etc. It should not be left blank to ensure proper execution. |
9. InsertItemInCollection
This keyword inserts the given item in the Collection data. It takes Collection Data, Value & index of data to be inserted as data input arguments.
Input Arguments
Object Input Arguments | Required? | Description |
Object | No | This keyword doesn’t take any object input argument. |
Data Input Arguments | Required? | Description |
Data | Yes | This keyword takes Collection Data, Value & index of data to be inserted as data input arguments. Note: You can provide Data from Global Variables, Step Output, or static data locally. |
Output
True | This keyword Passes if inserts the given data at the specified location in the Collection data. |
Example
If you want to insert “e” value data at index 1 in Collection Data
Data : [
"a",
"b",
"c"
]
*
then you need to use the InsertItemInCollection keyword. The output will be
[
"a",
"e",
"b",
"c"
]
Common Error Conditions
This keyword fails in the following common error scenarios as given below -
Condition | Debug Information | Message |
If the Value & index to be inserted is not given | One or more of the arguments have not been provided a value. The collection data is empty | Argument Data Missing (-13200) DESCRIPTION: A step might fail if it lacks values for required arguments. While certain arguments are optional, mandatory ones must be supplied with data. This data can be entered statically, derived from a prior step's output, sourced from a global variable, etc. It should not be left blank to ensure proper execution. |
If the Data is not given but the value to be inserted and index are given | One or more of the arguments have not been provided a value. The collection data is empty | Argument Data Missing (-13200) DESCRIPTION: A step might fail if it lacks values for required arguments. While certain arguments are optional, mandatory ones must be supplied with data. This data can be entered statically, derived from a prior step's output, sourced from a global variable, etc. It should not be left blank to ensure proper execution. |
10. InsertItemInKeyValuePairCollection
This keyword inserts the given item in the KeyValuePairCollection data. It takes KeyValuePairCollection Data, Value & index of data to be inserted as data input arguments.
Input Arguments
Object Input Arguments | Required? | Description |
Object | No | This keyword doesn’t take any object input argument. |
Data Input Arguments | Required? | Description |
Data | Yes | This keyword takes KeyValuePairCollection Data, Value & index of data to be inserted as data input arguments. Note: You can provide Data from Global Variables, Step Output, or static data locally. |
Output
True | This keyword Passes if inserts the given data at the specified location in the KeyValuePairCollection data. |
Example
If you want to insert
* Value : {
"Key": "c",
"Value": "03"
}
Index : 1
value data at index 1 in Collection Data
* Data : [
{
"Key": "a",
"Value": "01"
},
{
"Key": "b",
"Value": "02"
}
]
then you need to use InsertItemInKeyValuePairCollection keyword. The output will be
[
{
"Key": "a",
"Value": "01"
},
{
"Key": "c",
"Value": "03"
},
{
"Key": "b",
"Value": "02"
}
]
Common Error conditions
This keyword fails in the following common error scenarios as given below -
Condition | Debug Information | Message |
If the Value & index to be inserted is not given | One or more of the arguments have not been provided a value. The collection data is empty | Argument Data Missing (-13200) DESCRIPTION: A step might fail if it lacks values for required arguments. While certain arguments are optional, mandatory ones must be supplied with data. This data can be entered statically, derived from a prior step's output, sourced from a global variable, etc. It should not be left blank to ensure proper execution. |
If the Data is not given but the value to be inserted and index are given | One or more of the arguments have not been provided a value. The collection data is empty | Argument Data Missing (-13200) DESCRIPTION: A step might fail if it lacks values for required arguments. While certain arguments are optional, mandatory ones must be supplied with data. This data can be entered statically, derived from a prior step's output, sourced from a global variable, etc. It should not be left blank to ensure proper execution. |
11. MergeCollection
This keyword merges the 2 given Collection data. It takes Collection Data to be merged as data input arguments.
Input Arguments
Object Input Arguments | Required? | Description |
Object | No | This keyword doesn’t take any object input argument. |
Data Input Arguments | Required? | Description |
Data1 & Data2 | Yes | This keyword takes Collection Data to be merged as data input arguments. Note: You can provide Data from Global Variables, Step Output, or static data locally. |
Output
True | This keyword Passes if merges the given data into one Collection data. |
Example
If you want to merge
* Data1 : [
"a",
"b",
"c"
]
&
* Data2 : [
"1",
"2",
"3"
]
then you need to use InsertItemInKeyValuePairCollection keyword. The output will be
[
"a",
"b",
"c",
"1",
"2",
"3"
]
Common Error conditions
This keyword fails in the following common error scenarios as given below -
Condition | Debug Information | Message |
If Data1 is given but Data2 is not given | One or more of the arguments have not been provided with a value | Argument Data Missing (-13200) DESCRIPTION: A step might fail if it lacks values for required arguments. While certain arguments are optional, mandatory ones must be supplied with data. This data can be entered statically, derived from a prior step's output, sourced from a global variable, etc. It should not be left blank to ensure proper execution. |
If Data1 & Data2 are not given | One or more of the arguments have not been provided with a value | Argument Data Missing (-13200) DESCRIPTION: A step might fail if it lacks values for required arguments. While certain arguments are optional, mandatory ones must be supplied with data. This data can be entered statically, derived from a prior step's output, sourced from a global variable, etc. It should not be left blank to ensure proper execution. |
12. MergeKeyValuePairCollection
This keyword merges the 2 given KeyValuePairCollection data. It takes KeyValuePairCollection Data to be merged as data input arguments.
Input Arguments
Object Input Arguments | Required? | Description |
Object | No | This keyword doesn’t take any object input argument. |
Data Input Arguments | Required? | Description |
Data1 & Data2 | Yes | This keyword takes KeyValuePairCollection Data to be merged as data input arguments. Note: You can provide Data from Global Variables, Step Output, or static data locally. |
Output
True | This keyword Passes if merges the given data into one KeyValuePairCollection data. |
Example
If you want to merge
* Data1 : [
{
"Key": "1",
"Value": "AA"
},
{
"Key": "2",
"Value": "BB"
}
]
&
* Data2 : [
{
"Key": "A",
"Value": "11"
},
{
"Key": "B",
"Value": "22"
}
]
then you need to use MergeKeyValuePairCollection keyword. The output will be
[
{
"Key": "1",
"Value": "AA"
},
{
"Key": "2",
"Value": "BB"
},
{
"Key": "A",
"Value": "11"
},
{
"Key": "B",
"Value": "22"
}
]
Common Error conditions
This keyword fails in the following common error scenarios as given below -
Condition | Debug Information | Message |
If Data1 is given but Data2 is not given | One or more of the arguments have not been provided a value | Argument Data Missing (-13200) DESCRIPTION: A step might fail if it lacks values for required arguments. While certain arguments are optional, mandatory ones must be supplied with data. This data can be entered statically, derived from a prior step's output, sourced from a global variable, etc. It should not be left blank to ensure proper execution. |
If Data1 & Data2 are not given | One or more of the arguments have not been provided a value | Argument Data Missing (-13200) DESCRIPTION: A step might fail if it lacks values for required arguments. While certain arguments are optional, mandatory ones must be supplied with data. This data can be entered statically, derived from a prior step's output, sourced from a global variable, etc. It should not be left blank to ensure proper execution. |
13. RemoveItemFromCollection
This keyword removes a particular item from the given Collection data. It takes the Data and index of the item to be removed as data input arguments.
Input Arguments
Object Input Arguments | Required? | Description |
Object | No | This keyword doesn’t take any object input argument. |
Data Input Arguments | Required? | Description |
Data1 & Index | Yes | This keyword takes the Data and index of the item to be removed as data input arguments. Note: You can provide Data from Global Variables, Step Output, or static data locally. |
Output
True | This keyword Passes if it removes the given item from the Collection data successfully. |
Note: If No Index is given then it removes index 0 data from the Collection.
Example
If you want to remove Index 1 data from the Collection Data
* Data : [
"ABCD",
"EFGH",
"IJKL"
]
then you need to use RemoveItemFromCollection keyword. The output will be
[
"ABCD",
"IJKL"
]
Common Error conditions
This keyword fails in the following common error scenarios as given below -
Condition | Debug Information | Message |
If No Data and index are given | One or more of the arguments have not been provided with a value | Argument Data Missing (-13200) DESCRIPTION: A step might fail if it lacks values for required arguments. While certain arguments are optional, mandatory ones must be supplied with data. This data can be entered statically, derived from a prior step's output, sourced from a global variable, etc. It should not be left blank to ensure proper execution. |
14. RemoveItemFromKeyValuePairCollection
This keyword removes a particular item from the given KeyValuePair Collection data. It takes the Data and index of the item to be removed as data input arguments.
Input Arguments
Object Input Arguments | Required? | Description |
Object | No | This keyword doesn’t take any object input argument. |
Data Input Arguments | Required? | Description |
Data & Index | Yes | This keyword takes Data & Index of the item to be removed as as data input arguments. Note: You can provide Data from Global Variables, Step Output, or static data locally. |
Output
True | This keyword Passes if it removes the given item from the KeyValuePairCollection data successfully. |
Note: If No Index is given then it removes index 0 data from the Collection.
Example
If you want to remove Index 1 data from the KeyValuePairCollection Data
* Data : [
{
"Key": "a",
"Value": "Apple"
},
{
"Key": "b",
"Value": "Ball"
},
{
"Key": "c",
"Value": "Cat"
}
]
Index : 1
then you need to use RemoveItemFromKeyValuePairCollection keyword. The output will be
[
{
"Key": "a",
"Value": "Apple"
},
{
"Key": "c",
"Value": "Cat"
}
]
Common Error conditions
This keyword fails in the following common error scenarios as given below -
Condition | Debug Information | Message |
If No Data and index are given | One or more of the arguments have not been provided a value | Argument Data Missing (-13200) DESCRIPTION: |
15. ReverseCollection
This keyword reverses the given Collection Data. It takes Collection Data to be reversed as a data input argument.
Input Arguments
Object Input Arguments | Required? | Description |
Object | No | This keyword doesn’t take any object input argument. |
Data Input Arguments | Required? | Description |
Data | Yes | This keyword takes Collection Data as a data input argument. Note: You can provide Data from Global Variables, Step Output, or static data locally. |
Output
True | This keyword Passes if it reverses the given Collection data successfully. |
Note: If there is a single Collection value then it will remain the same.
Example
If you want to reverse Collection Data
* Data : [
"ABCDEFG",
"1234567"
]
then you need to use ReverseCollection keyword. The output will be
[
"1234567",
"ABCDEFG"
]
Common Error conditions
This keyword fails in the following common error scenarios as given below -
Condition | Debug Information | Message |
If No Data and index are given | One or more of the arguments have not been provided a value | Argument Data Missing (-13200) DESCRIPTION: A step might fail if it lacks values for required arguments. While certain arguments are optional, mandatory ones must be supplied with data. This data can be entered statically, derived from a prior step's output, sourced from a global variable, etc. It should not be left blank to ensure proper execution. |
16. ReverseKeyValuePairCollection
This keyword reverses the given KeyValuePairCollection Data. It takes KeyValuePair Collection Data to be reversed as a data input argument.
Input Arguments
Object Input Arguments | Required? | Description |
Object | No | This keyword doesn’t take any object input argument. |
Data Input Arguments | Required? | Description |
Data | Yes | This keyword takes KeyValuePair Collection Data as the data input argument. Note: You can provide Data from Global Variables, Step Output, or static data locally. |
Output
True | This keyword Passes if it reverses the given KeyValuePair Collection data successfully. |
Note: If there is a single KeyValuePair Collection value then it will remain the same.
Example
If you want to reverse Collection Data
* Data : [
{
"Key": "A",
"Value": "1"
},
{
"Key": "B",
"Value": "2"
}
]
then you need to use ReverseKeyValuePairCollection keyword. The output will be
[
{
"Key": "B",
"Value": "2"
},
{
"Key": "A",
"Value": "1"
}
]
Common Error conditions
This keyword fails in the following common error scenarios as given below -
Condition | Debug Information | Message |
If No Data and index are given | One or more of the arguments have not been provided a value | Argument Data Missing (-13200) DESCRIPTION: A step might fail if it lacks values for required arguments. While certain arguments are optional, mandatory ones must be supplied with data. This data can be entered statically, derived from a prior step's output, sourced from a global variable, etc. It should not be left blank to ensure proper execution. |
17. SetGlobalVariableCollection
This keyword sets the Global Variable Collection data as per the given Data. It takes VariableName & Data as the data input argument.
Input Arguments
Object Input Arguments | Required? | Description |
Object | No | This keyword doesn’t take any object input argument. |
Data Input Arguments | Required? | Description |
Data | Yes | This keyword takes VariableName Collection Data and Data as data input arguments. Note: You can provide VariableName Data from Global Variable & Data to be set from Step Output Global Variable. |
Output
True | This keyword Passes if it sets the Global Variable Collection as per the given data successfully. |
Example
If you want to set Collection Data
* VariableName : string
* Data : [
"Laptop",
"Desktop",
"Keyboard"
]
For a particular Global Variable Collection data you need to use SetGlobalVariableCollection keyword. The output will be True.
Common Error conditions
This keyword fails in the following common error scenarios as given below -
Condition | Debug Information | Message |
If VariableName is given but Data is not given | Collection data cannot be blank. | Argument Data Missing (-13200) DESCRIPTION: A step might fail if it lacks values for required arguments. While certain arguments are optional, mandatory ones must be supplied with data. This data can be entered statically, derived from a prior step's output, sourced from a global variable, etc. It should not be left blank to ensure proper execution. |
If VariableName & Data are not given | GlobalVariableName cannot be blank. | Argument Data Missing (-13200) DESCRIPTION: A step might fail if it lacks values for required arguments. While certain arguments are optional, mandatory ones must be supplied with data. This data can be entered statically, derived from a prior step's output, sourced from a global variable, etc. It should not be left blank to ensure proper execution. |
18. UpdateItemInKeyValuePairCollection
This keyword updates the particular item in the given KeyValuePair Collection. It takes Data, Items and indexes as data input arguments.
Input Arguments
Object Input Arguments | Required? | Description |
Object | No | This keyword doesn’t take any object input argument. |
Data Input Arguments | Required? | Description |
Data | Yes | This keyword takes Data, Items, and index as data input arguments as data input argument. Note: You can provide VariableName Data from Global Variable & Data to be set from Step Output Global Variable. |
Output
True | This keyword Passes if it updates the specified item of the KeyValuePair Collection data successfully. |
Example
If you want to update the item existing at index 1 with a new value ("Key": "Unix",
"Value": "2"). The input value is
* Data : [
{
"Key": "Apple",
"Value": "1"
},
{
"Key": "Mac",
"Value": "2"
},
{
"Key": "Windows",
"Value": "3"
}
]
* Item : {
"Key": "Unix",
"Value": "2"
}
The output value will be
[
{
"Key": "Apple",
"Value": "1"
},
{
"Key": "Unix",
"Value": "2"
},
{
"Key": "Windows",
"Value": "3"
}
]
then you need to use UpdateItemInKeyValuePairCollection keyword.
Note: If the index value is not given then it will update the item existing at index 0.
Common Error conditions
This keyword fails in the following common error scenarios as given below -
Condition | Debug Information | Message |
If Data, Items, and index are not given | One or more of the arguments have not been provided a value | Argument Data Missing (-13200) DESCRIPTION: A step might fail if it lacks values for required arguments. While certain arguments are optional, mandatory ones must be supplied with data. This data can be entered statically, derived from a prior step's output, sourced from a global variable, etc. It should not be left blank to ensure proper execution. |
19 UpdateValueInCollection
This keyword updates the particular Value in the given Collection data. It takes Data, Value, and index as data input arguments.
Input Arguments
Object Input Arguments | Required? | Description |
Object | No | This keyword doesn’t take any object input argument. |
Data Input Arguments | Required? | Description |
Data | Yes | This keyword takes Data, Value, and index as data input arguments. Note: You can provide Data from Global Variables, Step Output, and static data locally. |
Output
True | This keyword Passes if it updates the specified Value of the Collection data successfully. |
Example
If you want to update the item existing at index 2 with the new value (Value: 4; Index: 2). If the input value is
* Data : [
"1",
"2",
"3"
]
* Value : 4
Index : 2
Then the output value will be
[
"1",
"2",
"4"
]
In this case, you need to use UpdateValueInCollection keyword.
Note: If the index value is not given then it will update the item existing at index 0.
Common Error conditions
This keyword fails in the following common error scenarios as given below -
Condition | Debug Information | Message |
If Data, Items, and index are not given | One or more of the arguments have not been provided a value | Argument Data Missing (-13200) DESCRIPTION: A step might fail if it lacks values for required arguments. While certain arguments are optional, mandatory ones must be supplied with data. This data can be entered statically, derived from a prior step's output, sourced from a global variable, etc. It should not be left blank to ensure proper execution. |
To get into more detail about how you can use these keywords in your 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
Feedback sent
We appreciate your effort and will try to fix the article