Task: Obtain the names of the first 5 procurement plans from the «Supplier Portal» website and save them in an Excel file.
Solution:
Example:
Action «Open Browser» - choose «Chrome» from the drop-down list of browsers, and in the «Address» field, specify the link to the «Supplier Portal» website and navigate to the procurement plans tab. Example:
Action «Close Browser» - context browser.
Action «Open» - in the «File Path» parameter, specify the path to the Excel file.
Actions «Save» and «Close» - in the «Context» parameter, specify the previously opened Excel file.
Action «For»:
Parameter «Source» - the state of the loop iterator «For»; Parameter «Type» - «String.»
Example:
To create a web element, follow these steps:
Select «Add New Resource» as the method of filling the parameter.
Fill in the parameters «DisplayName,» for example, «Customer,» and «Default Attribute,» choosing «XPath» from the drop-down list.
Click the «Save» button.
In the action «Replace by Pattern,» specify:
Parameter «Text» - the previously created variable «Customer XPath»;
Parameter «Pattern» - the word «CUSTOMER» to be replaced;
Parameter «Substitution» - the result of the action «Convert Data.»
By using the «Concatenate» action from the «Text» group, combine column «A» and the row number equal to the state of the loop iterator. Since text values are combined, specify the result of the «Convert Data» action.
Parameter «Value» - the result of the «Get Text» action.
Start the robot.
The result of the robot’s work is a filled Excel file.