Tips and Tricks for working with Robot Framework – Part-1 – User friendly Tech help

If you are still looking for that one person who will change your life, take a look in the mirror.
n
nProblem1:- How i can generate random test data in Robot framework?
n
nSolution:- Use FakerLibrary
n
nInstall :- 
npip install robotframework-faker
n
nNote:- Include FakerLibrary in settings as “Library FakerLibary”
n
nExample:- To generate random number we can use code as below:-
n
nn

Problem2:- How to generate random value within given range?
n
nSolution:- Using Random keyword
n
nExample:-
n${randomValue} Evaluate random.randint(0, 5000) modules=random
n

nn


Problem3:- How to take screenshot on failures in Robot Framework?
n
nSolution:- Using Screenshot library
n1. Include the library in settings like Library Screenshot path_of_Directory 
n2. Capture the screenshot on failure
n

nn

nProblem4:- How to refresh browser in Robot Framework?
nSolution:- 
n1. Use “Reload” keyword
n2. Use “Execute JavaScript” 

nn

n
n
n
n
n
n
n
More ways to Refresh?
n
nLearn Robot Framework
nLearn Java

Was this article helpful?
YesNo

Similar Posts