История страницы
...
Get table Version 11 (Java)
Группа действийAction group: БраузерыBrowsers
Описание
Данное действие предназначено для получения таблицы в переменную.
Иконка действия
Параметры действия
Входные параметры
- Поле "Контекст" - Контекст действия для работы с браузером.
- Поле "Элемент" - Элемент для взаимодействия.
- Поле "С заголовком" - Если значение параметра равно true, то заголовок таблицы будет выделен отдельно.
- Поле "Удалять пустые" - Если значение параметра равно true, то будут удалены пустые строки/столбцы.
Выходные параметры
Результат - Результирующая переменная с данными в виде таблицы
Настройки
...
Description
The action gets tables to a variable
Action icon
Action parameters
Input parameters
"Context" field - the context of the action for working with the browser.
"Element" field - an element for interaction.
"With header" field - if the value is "true", the row with the table header will be highlighted separately.
"Remove empty" field - if the parameter value is true, empty rows/columns will be deleted.
"Remove duplicate header" field - if the value is "true", indexes will be added to the same column names in the header of the resulting table. The numbering starts from 1.
Output parameters
"Result" - the resulting variable with data in the form of a table.
Settings
Property | Description | Type | Example | Mandatory field |
---|---|---|---|---|
Parameters | ||||
Context | The context of the action for working with the browser | Robin.Selenium | Browser context | Yes |
Element | An element for interaction | Robin.WebElement | Yes | |
With header | If the value is "true", the row with the table header will be highlighted separately and will not be included in the rows with the contents of the table that the action returns | Robin.Boolean | true | No |
Remove empty | If the parameter value is true, empty rows/columns will be deleted | Robin.Boolean | true | No |
Remove duplicate header | If the value is "true", indexes will be added to the same column names in the header of the resulting table. The numbering starts from 1 | |||
Свойство | Описание | Тип | Пример заполнения | Обязательность заполнения поля |
Параметры | ||||
Контекст | Контекст действия для работы с браузером. | Robin.Selenium | Контекст браузера | Да | Элемент | Элемент для взаимодействия | Robin.WebElement | Да |
С заголовком | Если значение параметра равно true, то заголовок таблицы будет выделен отдельно. | Robin.Boolean | true | Нет |
Удалять пустые | Если значение параметра равно true, то будут удалены пустые строки/столбцы.Robin.Boolean | true | НетNo | |
Results | ||||
Result | The resulting variable with data in the form of a table | Результат | Результирующая переменная с данными в виде таблицы | Robin.DataTable |
Особые условия использования
Действие применимо только для элементов с типом table.
Для чек-бокса "С заголовком":
Special conditions of use
The action is only applicable with the table type elements
For a "With header" checkbox:
Parameter workflow: If "true", the action will save the first row of the source table into the header of the returned table value, i.e. it will not be a row with the table contents.
If "false", the first row will leave the table content part and the header will use the default names Работа параметра: При значении "true" действие первую строку исходной таблицы сохранит в заголовок возвращаемого табличного значения, т.е. она не будет являться строкой с содержимым таблицы.
При "false" первую строку оставит в части с содержимым таблицы, а в заголовке будут использоваться названия по умолчанию - 1, 2, 3 и т, etc.д.
ПримерExample:
Забираем таблицуGet the spreadsheet:
With this parameter enabled, the log will show "ColumnsПри включенном параметре в логе будет указано "Столбцов: 3; строкrows: 2", т.к. Первая строка взятой области стала заголовком с названиями столбцов "№", "Название" и "Тесты". К этим заголовкам нельзя обратиться как к строке данных, чтобы прочитать, но можно использовать имена столбцов, чтобы обратиться к конкретной ячейке или столбцу (действиями из группы "Таблицы"). Если параметр выключен, то в логе будет указано "Столбцов: 3; строк: 3", названия столбцов в заголовке будут " because the first row of the taken area becomes a header with the column names "No.", "Title", and "Tests". These headings cannot be accessed as a row of data to read, but you can use the column names to access a specific cell or column (actions from the "Tables" group). If the option is off, the log will show "Columns: 3; rows: 3", the column names in the header will be "1", "2" и and "3".
For "Remove duplicate header" checkbox
- If "false", column names will stay the same.
...
- If "true", each column name of the received table will need a check:
- Is there any other column with the same name? If not, the column is skipped, the next one will be checked. If there is one, an index will be added to the current name (numbering starts with 1).
- The check is repeated for the new name. But if now there is a duplicate for the new name, then the index is not added to it again, but the current index is increased by 1. This check point is repeated until there are no duplicates left for the new name.
- There is no change in the order of columns by their new names. For example, there were names "Test4", "Test" and "Test". After changing the duplicates, the names of the last 2 columns will change, but the order will remain the same:
Before: "Test4", "Test", "Test"
After: "Test4", "Test1", "Test"
Incorrect option: "Test", "Test1", "Test4".
Example of column renaming
There is a table in the browser:
If "Remove duplicate header" = true, and "With header" = True, the action will return a table with five unique headers. The column renaming will go as follows:
- The 1st column has a duplicate in the 2nd column. Add 1 to the name (it will be "Test1"), but if you do this, you will get a duplicate with a 3rd column. Therefore, we increase the index - 2 (there will be "Test2"), but with This index there will be a duplicate - with 4 and 5 columns. Once again, increase the index - 3, there are no duplicates for the resulting name "Test3", then we leave it. The resulting columns:
- Columns 2 and 3 do not have duplicates, skip them.
- Column 4 has a duplicate in column 5. Add 1 to the name (it will be "Test21"), there are no duplicates with this index in other columns. Final columns:
- Column 5 does not have duplicates. The check is finished. The 5th column has no doubles. The check is completed.
Example of use
Task
Get the table in the variable "Table" located on the page on the Internet.
Solution
Use the "Open browser", "Get table" actions.
Implementation
- Assemble a robot scheme with the actions:
- Set the "Open browser" action parameter.
- Set the "Get table" action parameters. More about filling in the "Element" field in section Create Web-elements
- Start the robot by clicking "Start" in the top panel.
Result
The program robot completed successfully. We got the table.
Пример использования
Задача
Получить таблицу в переменную "Таблица", расположенную на странице в интернете
Решение
Воспользоваться действиями "Открыть браузер", "Перейти по URL", "Получить таблицу".
Реализация
...
Результат
Программный робот отработал успешно. Таблица получена.