Showing results for 
Search instead for 
Did you mean: 

Testing of Traffic script

New Member

Testing of Traffic script

Hi All,

1. Is there any way by which we can test our traffic scirpt similar to unit testing? 

 We are using Http Client to generate request to traffic manager using Cucumber testing framework (Java). 

Is there any way by which we can get line coverage of the rules which are being executed from the test?

Can someone suggest any solution for this? or any other solution how can we have automated  testing our traffic script?


2. We have seen that in "event log" the rule name comes along with log message. But not sure how can we use that to atleat know which rule file is being executed? Thoughts?

Community Manager

Re: Testing of Traffic script

Hello - I didn't see an answer posted to this, so here are some thoughts:


There is no line-by-line coverage check, only function/rule-level coverage - in the logs, you should find both a Rule name and a Virtual Server name that tags along with each entry, something like:


[23/Aug/2019:18:23:18 +0200]    INFO    rules/example       rulelogmsginfo  vservers/example     Hello World!



If needed, you can add extra messages using statements of the form: ... ); or
log.debug( ... ); 


However, make sure you don't create too many extra log entries, as this can flood the logfile and make it difficult to read.