CapturingNetwork Traffic - It could be used to know details such as the browser information.
public class Epc extends SeleneseTestCase
{
public static SeleniumServer selServer;
public static DefaultSelenium selenium;
final String URL = "http://10.10.7.48:38080/";
int port = Constants.PORT;
String browser = Constants.BROWSER;
public void setUp() throws Exception
{
if(selServer == null)
{
try
{
RemoteControlConfiguration rc = new RemoteControlConfiguration();
rc.trustAllSSLCertificates();
selServer = new SeleniumServer(rc);
selServer.start();
}catch(Exception e)
{
e.printStackTrace();
}
}
}
public void testWebservices() throws Exception
{
selenium = new DefaultSelenium("localhost",Constants.PORT,Constants.BROWSER,URL);
selenium.start("captureNetworkTraffic=true");
selenium.open("/epc-client");
String trafficOutput = selenium.captureNetworkTraffic("plain");
System.out.println("\nNetwork Traffic captured in plain format !!!!"+trafficOutput);
pause(Constants.MAX_WAIT_TIME_MS);
selenium.windowFocus();
selenium.windowMaximize();
selenium.useXpathLibrary("javascript-xpath");
pause(Constants.MAX_WAIT_TIME_MS);
selenium.click("link=Search UPRN by Address Web Service");
}
}
public void tearDown()
{
selenium.stop();
selServer.stop();
}
}
i have ran the same code in my machine and my URL is www.google.co.in
ReplyDeleteBut Ouput in console displayed as
[]
rather than this nothing is displaying in console.
Please help me to get the correct output