Verify Regex in Robot Framework? – User friendly Tech help

Problem:- How to verify given regular expression using Robot Framework
n
nSolution:-

n


A pessimist sees the difficulty in every opportunity; an optimist sees the opportunity in every difficultyyyyy

n

1.Create a regular expression using online tool
nExample:- we want to verify 34.4% we will create a regular expression first 

nn

n2.Use Should Match Regex keyword
n
n
n
Example 1 :-
nWe want to verify whether dynamic pattern like 34.4% exists on UI
nExample2:-
nVerify that uuid like 9100d6678-1b1c-45b445-bdf9-47bc0b15a603 exists on UI 
n
nCode:-

n

${cpuUsage} Get Text //test/div 
Should Match Regexp ${cpuUsage} ^[0-9]{1,2}[.][0-9]% CPU Usage validation
${uuidNumber} Get Text //test/div
Should Match Regexp ${uuidNumber} [0-9a-z-] UUID validation

n

nMore Examples

Was this article helpful?
YesNo

Similar Posts