Hi,
I have tried to create a robot with the following scenario:
I have an excel file with two columns: 1.Username and 2.Role
I have created simple Windows application with one input field for username, a drop down menu(where the user can select role), and checkboxes to check the permissions.
Until this moment, I have succeeded to get the usernames from the excel file and insert them in the input field.
I need help with choosing the exact option from the dropdown for each of the usernames and check different checkboxes. For example, if User1 is inserted, Front Office should be selected, and View account info checked, if User11 is inserted, Back Office should be selected from the dropdown and create account should be checked, etc.
I cannot find any regular if statement for this part of the scenario, except for Run Keyword if/Run Keyword unless, which I do not find useful in my case.
Please checkout the screenshot and the code below, and let me know if there is any solution. There is also a screenshot of the excel file data in comment.
Thanks!
C O D E:
*** Settings ***
Documentation An example robot.
Library RPA.Desktop.Windows
Library RPA.Excel.Files
*** Keywords ***
Open Application and type username using data from excel file
Open Workbook WindowsApp_Data.xlsx
{usernames}= Read Worksheet As Table header=True
{roles}= Read Worksheet As Table header=True
Close Workbook
FOR {username} {role} IN ZIP @{usernames} @{roles}
Open Application and type name {username} {role}
END
*** Keywords ***
Open Application and type name
[Arguments] {username} {role}
Open From Search WindowsFormsApp1.exe Demo Windows Forms App
sleep 5
Type keys {username}\[Username]
Mouse click name:View avvount info
Mouse click name:Open
sleep 3
Mouse click name:{role}[Role]
Mouse click name:Save
Mouse click name:OK
[Teardown] Mouse click name:Close
*** Tasks ***
Open Application and type username using data from excel file
Open Application and type name
Log Done.