-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtasks.robot
59 lines (49 loc) · 2.13 KB
/
tasks.robot
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
*** Settings ***
Documentation Robot to solve the first challenge at rpachallenge.com,
... which consists of filling a form that randomly rearranges
... itself for ten times, with data taken from a provided
... Microsoft Excel file.
Library RPA.Browser.Selenium
Library RPA.Excel.Files
Library RPA.HTTP
*** Tasks ***
Complete the challenge
Start the challenge
Fill the forms
Collect the results
*** Keywords ***
Start the challenge
Open Available Browser http://rpachallenge.com/ headless=${True}
Download
... https://rpachallenge.com/assets/downloadFiles/challenge.xlsx
... overwrite=True
Click Button Start
# Click Button xpath:/html/body/app-root/div[2]/app-rpa1/div/div[1]/div[6]/button
Fill the forms
${people}= Get the list of people from the Excel file
FOR ${person} IN @{people}
FIll and submit the form ${person}
END
Get the list of people from the Excel file
Open Workbook challenge.xlsx
${table}= Read Worksheet As Table header=True
Close Workbook
RETURN ${table}
FIll and submit the form
[Arguments] ${person}
Input Text css:input[ng-reflect-name="labelFirstName"] ${person}[First Name]
Input Text css:input[ng-reflect-name="labelLastName"] ${person}[Last Name]
Input Text css:input[ng-reflect-name="labelCompanyName"] ${person}[Company Name]
Input Text css:input[ng-reflect-name="labelRole"] ${person}[Role in Company]
Input Text css:input[ng-reflect-name="labelAddress"] ${person}[Address]
Input Text css:input[ng-reflect-name="labelEmail"] ${person}[Email]
Input Text css:input[ng-reflect-name="labelPhone"] ${person}[Phone Number]
Click Button Submit
Set value by xpath
[Arguments] ${xpath} ${value}
${result}=
... Execute Javascript
... document.evaluate('${xpath}',document.body,null,9,null).singleNodeValue.value='$(value)';
... RETURN ${result}
Collect the results
Capture Element Screenshot css:div.congratulations