While automating a web application, quite often you might have experienced failure of your test cases during their execution due to changed properties of dynamic objects fetched in your Object Repository. These dynamic objects often change their properties such as name, id, value etc. In order to handle these dynamic objects, you can use ‘Is Regex’ feature. Is Regex stands for Is Regular Expression.
A practical scenario:
Suppose you are recording a test flow when name object value is vivek but due to being dynamic in nature, its value get changed to vivek at runtime. In such cases, your test execution get failed as it look for vivek and the existing name object value is vivek.
Such scenarios can be easily handled by using the Is Regex feature of Opkey. Here in this scenario, vivek is the Regular Expression part which is static in nature.
- Open your Object Repository and go to the Object Property value.
- Check Is Regex checkbox corresponding to the dynamic object, to make the particular dynamic object value as Regular Expression.
- Save the object.
Now during test execution, Opkey will look for the vivek value of dynamic object and will ignore the dynamic value. Your test execution will run successfully without getting failed.