ZennoLab Assemblies Documentation
GetTraffic Method (Tab)
Example 
ZennoLab.CommandCenter Namespace > Tab Class : GetTraffic Method
Returns collection of requests for current tab.
Syntax
public IEnumerable<TrafficItem> GetTraffic()

Return Value

Type: System.Collections.IEnumerable

Collection of requests.

Example
The following code example demonstrates uses of the GetTraffic method.
// navigate to url
instance.ActiveTab.Navigate("http://lessons.zennolab.com");
// get list of requests
var list = instance.ActiveTab.GetTraffic();
// print count of items, it will be more than 0
project.SendInfoToLog("First count of traffic elements = " + list.Count());
// get some data from items and log it
foreach(var t in list)
    project.SendInfoToLog(string.Format("Url: {0}\r\n Method: {1}\r\n Result: {2}", t.Url, t.Method, t.ResultCode), true);
// get list of request second time
var list2 = instance.ActiveTab.GetTraffic();
// print count of items, it will be 0, because the previous method call removed the old items
project.SendInfoToLog("Second count of traffic elements = " + list2.Count());
Requirements

Target Platforms: Desktop: Windows XP SP3 and older. Server: Windows Server 2003 and older.

See Also

Reference

Tab Class
Tab Members