Good morning guys
I have an automation ready and working to register employees. During registration most of the fields can be filled in with fictitious data and I managed to do it well using FakerLibrary, but there are two fields that I need to inform valid data that I declared like this in the resources file:
*** Variables ***
${CPF} 56932225603 #personal identification document
${ICCID} 89550511260000100099 #simcard code
*** Keywords ***
part of the code where the variables are.
Inform CPF
Wait Until Page Contains Element name=filter
Input Text name=filter ${CPF}
Sleep 5s
Wait Until Page Contains Element xpath=//button[@type=‘submit’][contains(.,‘Search’)]
Click Element xpath=//button[@type=‘submit’][contains(.,‘Search’)]
Sleep 1s
Wait Until Page Contains Element xpath=//h1[contains(.,‘Customer not found!’)]
Inform resources
Wait Until Page Contains Element id=resourcesIccidText
Input Text id=resourcesIccidText ${ICCID}
Set Focus To Element id=btn-wizard-next
sleep 2s
Click Element xpath=//button[@type=‘button’][contains(.,‘NEXT’)]
Wait Until Page Contains Element xpath=//*[text()=‘test@test.com’]
Every time I need to make a new registration, I manually get new data that is in a .txt file and change the variables.
If I need to run the test 10x, I make this change in the variables 10x and here are my doubts:
1 - How do I make the Robot run this test more than once, for example run 4x?
2 - Would it be possible to make these variables be of the list type and each time the test runs it consumes the list?
If the registration succeeds, the ‘CPF and ICCID’ data used cannot be used anymore, so I manually delete them from the .txt file.