Collecting resource IP addresses

You can collect IP addresses for every resource downloaded from a page. After the step to navigate to a page in your recorded script, right-click and select Advanced > Add JavaScript. Select the newly added custom JavaScript step to view its properties in the Script action properties pane.

JavaScript action properties

JavaScript action properties

Add the following code to the src field to capture resource IP addresses:

var nResCount= CurrentResource.Size();
  var text="";
  Actions.print("Resource size "+ nResCount);
  Actions.print("Resource count "+ CurrentResource.ChildCount());
  text = " Resource IP " + CurrentResource.IP();
  Actions.print(text);
  Actions.print(" Resource Url " + CurrentResource.Url());
for (var i=1; i<CurrentResource.ChildCount()-1; i++){
  var l_res= CurrentResource.GetChild(i);
  text = i+ " Resource IP " + l_res.IP();
  Actions.print(text);
  Actions.print(i+ " Resource URL "  + l_res.Url());
  };