Test URL Condition

Test URL condition feature helps you validate whether the rule source url condition you have setup works for the request URL you want it work with. This helps improving your rule creation and editing experience more fluent especially when using regex or wildcard operators.

To test a URL condition:

  1. Open any rule editor
  1. Enter the source url condition which suits your case
  1. Click on the **flask icon, **this opens a test URL popup modal

This popup modal has these following components:

  1. Source condition: This is the source condition which was earlier defined in the rule editor. This is editable, you can change the source condition to satisfy the rule condition if required.
  1. **URL field: **Enter the complete URL on which you want the rule to be applied
  1. Result: Here the test results show up indicating if the rule will be applied on the URL entered in the URL field or not.

Testing URL with Regex Condition

To test a URL with a regex pattern in source url condition, In the URL field, enter the complete URL on which you want to apply the rule. The result will show whether the rule will be applied on the URL or not based on the regex pattern.

Examples:

Source condition: /^https://.*github.*/ URL entered: https://subdomain.github.io/ **Result: ✅ **The URL matches the source condition defined

Source condition: /^https://blog\..*\.com$/** URL entered**: https://blog.example.com/ **Result: ✅ **The URL matches the source condition defined

Source condition: /^((?!example).)*$/** URL entered**: https://www.examplewebsite.com/ **Result: ❌ **The URL does not matches the source condition defined

 

💡

NOTE Make sure that the regex pattern in source condition is valid and enclosed with slashes(/). Example: /^https://.*github.* ❌ Invalid regex /^https://.*github.*/ ✅ Valid regex /(.+)://(.+).example.com/ig ✅ Valid regex

Testing URL with Wildcard Condition

To test a URL with a wildcard pattern in source url condition, In the URL field, enter the complete URL on which you want to apply the rule. The result will show whether the rule will be applied on the URL or not based on the wildcard pattern.

Examples:

Source condition: *://*.yahoo.com URL entered: http://cricket.yahoo.com Result: ✅ The URL matches the source condition defined

Source condition: *google*.com?param=* URL entered: https://www.google.com/page?param=value Result: ✅ The URL matches the source condition defined

Source condition: *example*.com?param=* URL entered: https://www.examplewebsite.com/page?param=test Result: ❌ The URL does not matches the source condition defined

Updated on