| || |
Tools/Add ons for testing rules engine
I am trying to automate the testing of the results of a rules engine. Basically the rule engine output is a flat xml with a set of business rules that is then run against a data set. Based on the rule set the test data upload triggers these rules and a subset of these rules get executed and result in pass or fail. This is dynamic and is based on what test data is uploaded. I tried to use selenium webdriver for a simple UI (Pass/fail) but the issues is the result is dynamic and doesnt trigger the same rules - so the results are very data driven. Any suggestions? Eg: Rules are something like:
If testdata param1 = A, meet condition 1,
If testdata param2 = B, meet condition 2,
If testdata param 3 = C, meet condition 3.
If testdata param1 = D, meet condition 4,
If testdata param2 = E, meet condition 5.
Now I load testdata1 &2 where for testdata1, only meets condition 2&3, and testdata2 meets condition 1,4. How do I verify this without hardcoding the testdata set. Hopefully I havent confused too much
The answer you're looking for doesn't fall under Selenium. Selenium only gives you browser control.
There's 2 places you can think of implementing that..
1) Having a single test then driving it off different data is what we call a Data Driven Test. Many frameworks support it. You may want to search for "(your test framework) data driven" or "your test framework DDT".
2) Another way of implementing logic in a test is just that, putting logic into your test. (Although I discourage the practice in general) The programming language will have ways you can read an external and you can use basic building blocks such as if/else and loops to implement what you want to do.