История страницы
...
Compare Version 6 (Java)
Группа действийAction group: JSON
Описание
Действие сравнивает два JSON и возвращает true, если они одинаковые, и false, если нет.
Иконка
Параметры действия
Входные параметры
Первый JSON Первый JSON для сравнения
Второй JSON Второй JSON для сравнения
Выходные параметры
Результат Логическая переменная, значение которой равно true, если файлы равны, иначе - false.
Настройки
...
Description
The action compares two JSON files and returns "true" if they are same, and "false" if not.
Action icon
Settings of parameters
Property | Description | Type | Filling example | Mandatory field |
Parameters | ||||
First JSON | First JSON for comparing | Robin.JSON | Yes | |
Second JSON | Second JSON for comparing | Robin.JSON | Yes | |
Results | ||||
Result | Logical variable whose value is true if files are equal, otherwise |
Первый JSON
Первый JSON для сравнения
Robin.JSON
Да
Второй JSON
Второй JSON для сравнения
Robin.JSON
Да
Результат
false. | Robin.Boolean | true |
Особые условия использования
Отсутствуют
Пример использования
Задача
Сравнить 2 JSON файла.
Special conditions of use
None.
Example of use
Task
Compare two JSON files.
Первый файл The first file test.json:
Блок кода | ||||||
---|---|---|---|---|---|---|
| ||||||
{ "firstname":"Joe", "lastname": "Jackson", "gender":"male", "age": 28, "address": { "streetAddress": "101", "city": "San Diego", "state": "CA" }, "phonenumber": [ { "type": "home", "number": "9349282382"} ] } |
Второй файл The second file test 2.json:
Блок кода | ||||||
---|---|---|---|---|---|---|
| ||||||
{ "firstname":"Joil", "lastname": "Jackson", "gender":"male", "age": 31, "address": { "streetAddress": "101", "city": "San Diego", "state": "CA" }, "phonenumber": [ { "type": "home", "number": "79349282382"} ] } |
...
Solution
Воспользоваться действиями Use the "Open", "Compare" actions.
Реализация
...
Implementation
- Assemble a robot scheme with the actions.
- Set the "Open" action parameters (1st file).
- Set the "Open" action parameters (2nd file).
- Set the "Compare" action parameters.
- Click "Start" in the top panel.
Result
The program robot completed successfully. The contents of the two files are different.
Результат
Программный робот отработал успешно. Содержимое файлов различно.