1. Home
  2. Opkey Help
  3. 25. Opkey Keyword Documentation
  4. 25.11 Collection keywords

25.11 Collection keywords

AddItemInCollection

AddItemInCollection

This keyword is used to add an item in collection. It takes Collection Data & item 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 Data & Item to be added as data input arguments.

Note: You can provide Collection Data from Global Variable or static data locally.

Output

True

This keyword Passes if the given item is added to the Collection successfully.

Example

If you want to add Item : dff in Collection (Data)

Data : [
“asd”,
“asdf”,
“add”
]

then you need to use AddItemInCollection keyword. The output will be

[
“asd”,
“asdf”,
“add”,
“dff”
]

Data Input Arguments:

Common Error conditions

This keyword fails in 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.

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

 

AddItemInKeyValuePairCollection

AddItemInKeyValuePairCollection

This keyword is used to add corresponding item in KeyValuePairCollection. It takes KeyValuePairCollection Data & item 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 Variable 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 AddItemInKeyValuePairCollection keyword. The output will be

[
{
“Key”: “1”,
“Value”: “class”
},
{
“Key”: “2”,
“Value”: “sec”
},
{
“Key”: “3”,
“Value”: “rollno”
}
]

Data Input Arguments:

 

Common Error conditions

This keyword fails in 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.

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

CheckDuplicacyInCollection

CheckDuplicacyInCollection

This keyword is used to check the duplicacy in the given Collection. It takes 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 as data input argument.

Note: You can provide Collection Data from Global Variable or static data locally.

 

Output

 

True

This keyword Passes if it finds duplicacy in the specified Collection Data. It returns output as False if No duplicacy found in Collection.

 

 

 

Example

 

If you want to find out duplicacy in

Data : [
“asd”,
“asd”,
“asd”,
“asd”
]

then you need to use CheckDuplicacyInCollection keyword. The output will be True.

 

Data Input Arguments:

 

Common Error conditions

This keyword fails in 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.

CheckDuplicacyInKeyValuePairCollection

 

CheckDuplicacyInKeyValuePairCollection

This keyword is used to check the duplicacy in the given KeyValuePairCollection. It takes 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 KeyValueCollection Data as 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 output as False if No duplicacy 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 CheckDuplicacyInKeyValuePairCollection keyword. The output will be True.

 

Data Input Arguments:

 

 

 

 

 

Common Error conditions

This keyword fails in 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.

GetCollectionOfDelimitedString

 

GetCollectionOfDelimetedString

This keyword is used to get the Collection of String with no delimiter. It takes Collection Data & Delimiter 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 & Delimiter as data input argument.

Note: You can provide Collection Data from Global Variable or static data locally.

 

Output

 

True

This keyword Passes if gets Collection data while removing delimiter from the string Collection.

 

 

 

Example

 

If you want to get the Collection by removing the delimiter (comma) from the Apple, Carrot, Mango, Banana then then you need to use GetCollectionOfDelimetedString keyword. The output will be Apple Carrot Mango Banana.

 

Data Input Arguments:

 

 

Common Error conditions

This keyword fails in 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.

 

GetItemFromCollection

GetItemFromCollection

This keyword is used to get a particular item from the given Collection. It takes 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 Variable 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 then you need to use GetItemFromCollection keyword. The output will be b.

 

Data Input Arguments:

Common Error conditions

This keyword fails in 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 index is greater or equal to collection items limit.

If No Collection Data is given but Index is given

One or more of the arguments have not been provided a value. 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, output of a previous step, a global variable etc; but it must not be left blank.

GetItemFromKeyValuePairCollection

GetItemFromKeyValuePairCollection

This keyword is used to get 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 Variable, 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 then you need to use GetItemFromKeyValuePairCollection keyword. The output will be

{
“Key”: “rollno”,
“Value”: “12”
}

.

Data Input Arguments:

Common Error conditions

This keyword fails in 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 index is greater or equal to collection items limit.

If No Collection Data is given but Index is given

One or more of the arguments have not been provided a value. 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, output of a previous step, a global variable etc; but it must not be left blank.

GetSizeOfCollection

GetSizeOfCollection

This keyword is used to get the size of the specified Collection. It takes 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 as data input arguments.

Note: You can provide Collection Data from Global Variable, 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 then you need to use GetItemFromKeyValuePairCollection keyword. The output will be

{
“Key”: “rollno”,
“Value”: “12”
}

.

Data Input Arguments:

Common Error conditions

This keyword fails in 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 index is greater or equal to collection items limit.

If No Collection Data is given but Index is given

One or more of the arguments have not been provided a value. 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, output of a previous step, a global variable etc; but it must not be left blank.

GetSizeOfKeyValuePairCollection

GetSizeOfKeyValuePairCollection

This keyword is used to get the size of the specified KeyValuePairCollection. It takes 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

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 size of the specified KeyValuePairCollection Data.

Example

If you want to get size of the KeyvaluePairCollection Data

Data : [
{
“Key”: “a”,
“Value”: “1”
},
{
“Key”: “b”,
“Value”: “2”
},
{
“Key”: “c”,
“Value”: “3”
}
]

then then you need to use GetSizeOfKeyValuePairCollection keyword. The output will be 3.

 

Data Input Arguments:

Common Error conditions

This keyword fails in following common error scenarios as given below –

Condition

Debug Information

Message

If No Collection Data is given but Index is given

One or more of the arguments have not been provided a value. 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, output of a previous step, a global variable etc; but it must not be left blank.

 

InsertItemInCollection

InsertItemInCollection

This keyword is used to insert the given item in the Collection data. It takes Collection Data, Value & index of data to be inserted 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

Data

Yes

This keyword takes Collection Data, Value & index of data to be inserted as as data input arguments.

Note: You can provide Data from Global Variable, 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 then you need to use InsertItemInCollection keyword. The output will be

[
“a”,
“e”,
“b”,
“c”
]

Data Input Arguments:

Common Error conditions

This keyword fails in 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. 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, output of a previous step, a global variable etc; but it must not be left blank.

If the Data is not given but value to be inserted and index are given

One or more of the arguments have not been provided a value. 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, output of a previous step, a global variable etc; but it must not be left blank.

InsertItemInKeyValuePairCollection

InsertItemInKeyValuePairCollection

This keyword is used to insert the given item in the KeyValuePairCollection data. It takes KeyValuePairCollection Data, Value & index of data to be inserted 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

Data

Yes

This keyword takes KeyValuePairCollection Data, Value & index of data to be inserted as as data input arguments.

Note: You can provide Data from Global Variable, 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 then you need to use InsertItemInKeyValuePairCollection keyword. The output will be

[
{
“Key”: “a”,
“Value”: “01”
},
{
“Key”: “c”,
“Value”: “03”
},
{
“Key”: “b”,
“Value”: “02”
}
]

 

Data Input Arguments:

Common Error conditions

This keyword fails in 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. 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, output of a previous step, a global variable etc; but it must not be left blank.

If the Data is not given but value to be inserted and index are given

One or more of the arguments have not been provided a value. 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, output of a previous step, a global variable etc; but it must not be left blank.

MergeCollection

MergeCollection

This keyword is used to merge the 2 given Collection data. It takes Collection Data to be merged 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

Data1 & Data2

Yes

This keyword takes Collection Data to be merged  as data input arguments.

Note: You can provide Data from Global Variable, 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 then you need to use InsertItemInKeyValuePairCollection keyword. The output will be

[
“a”,
“b”,
“c”,
“1”,
“2”,
“3”
]

Data Input Arguments:

 

Common Error conditions

This keyword fails in 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 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.

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

MergeKeyValuePairCollection

MergeKeyValuePairCollection

This keyword is used to merge the 2 given KeyValuePairCollection data. It takes KeyValuePairCollection Data to be merged 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

Data1 & Data2

Yes

This keyword takes KeyValuePairCollection Data to be merged  as data input arguments.

Note: You can provide Data from Global Variable, 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 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”
}
]

Data Input Arguments:

Common Error conditions

This keyword fails in 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 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.

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

 

RemoveItemFromCollection

RemoveItemFromCollection

This keyword is used to remove a particular item from the given Collection data. It takes Data & Index of the item to be removed 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

Data1 & 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 Variable, 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 then you need to use RemoveItemFromCollection keyword. The output will be

[
“ABCD”,
“IJKL”
]

Data Input Arguments:

Common Error conditions

This keyword fails in following common error scenarios as given below –

Condition

Debug Information

Message

If No Data & Index 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.

RemoveItemFromKeyValuePairCollection

RemoveItemFromKeyValuePairCollection

This keyword is used to remove a particular item from the given KeyValuePair Collection data. It takes Data & Index of the item to be removed 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

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 Variable, 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 then you need to use RemoveItemFromKeyValuePairCollection keyword. The output will be

[
{
“Key”: “a”,
“Value”: “Apple”
},
{
“Key”: “c”,
“Value”: “Cat”
}
]

Data Input Arguments:

Common Error conditions

This keyword fails in following common error scenarios as given below –

Condition

Debug Information

Message

If No Data & Index 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.

ReverseCollection

ReverseCollection

This keyword is used to reverse the given Collection Data. It takes Collection Data to be reversed as as 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 as data input argument.

Note: You can provide Data from Global Variable, Step Output or static data locally.

Output

True

This keyword Passes if it reverses the given Collection data successfully.

Note: If there is single Collection value then it will remain same.

Example

If you want to reverse Collection Data

* Data : [
“ABCDEFG”,
“1234567”
]

then then you need to use ReverseCollection keyword. The output will be

[
“1234567”,
“ABCDEFG”
]

Data Input Arguments:

Common Error conditions

This keyword fails in following common error scenarios as given below –

Condition

Debug Information

Message

If No Data & Index 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.

ReverseKeyValuePairCollection

ReverseKeyValuePairCollection

This keyword is used to reverse the given KeyValuePairCollection Data. It takes KeyValuePair Collection Data to be reversed as as 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 as data input argument.

Note: You can provide Data from Global Variable, Step Output or static data locally.

Output

True

This keyword Passes if it reverses the given KeyValuePair Collection data successfully.

Note: If there is single KeyValuePair Collection value then it will remain same.

Example

If you want to reverse Collection Data

* Data : [
{
“Key”: “A”,
“Value”: “1”
},
{
“Key”: “B”,
“Value”: “2”
}
]

then then you need to use ReverseKeyValuePairCollection keyword. The output will be

[
{
“Key”: “B”,
“Value”: “2”
},
{
“Key”: “A”,
“Value”: “1”
}
]

Data Input Arguments:

Common Error conditions

This keyword fails in following common error scenarios as given below –

Condition

Debug Information

Message

If No Data & Index 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.

SetGlobalVariableCollection

SetGlobalVariableCollection

This keyword is used to set the Global Variable Collection data as per the given Data. It takes VariableName & Data as as 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 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 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 then you need to use SetGlobalVariableCollection keyword. The output will be True.

 

Data Input Arguments:

 

Common Error conditions

This keyword fails in 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 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.

If VariableName & Data both are not given

GlobalVariableName cannot be blank.

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.


 

UpdateItemInKeyValuePairCollection

UpdateItemInKeyValuePairCollection

This keyword is used to update the particular item in the given KeyValuePair Collection. It takes Data, Item & Index 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

Data

Yes

This keyword takes Data, Item & Index as 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 the of the KeyValuePair Collection data successfully.

 

Example

 

If you want to update the item existing at index 1 with 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.

 

Data Input Arguments:

 

Common Error conditions

This keyword fails in following common error scenarios as given below –

 

Condition

Debug Information

Message

If Data, Item & Index are not  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.

 

UpdateValueInCollection

UpdateValueInCollection

This keyword is used to update the particular Value in the given Collection data. It takes Data, Value & Index 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

Data

Yes

This keyword takes Data, Value & Index as as data input arguments.

Note: You can provide Data from Global Variable, Step Output & Static data locally.

 

Output

 

True

This keyword Passes if it updates the specified Value the of the Collection data successfully.

 

Example

 

If you want to update the item existing at index 2 with 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.

 

Data Input Arguments:

 

Common Error conditions

This keyword fails in following common error scenarios as given below –

 

Condition

Debug Information

Message

If Data, Item & Index are not  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.

 

GetIndexValueFromCollection

Was this article helpful to you? Yes No