I running my test using grid2 and Testng. Running the test remotely.
The problem am facing is when i have two test methods in one suite only one test HTTP request and response is recorded instead of two.
I have used Beforesuite and Aftersuite annotations.
If they are replaced with AfterTest and BeforeTest they are properly recodred.
@BeforeSuite
ProxyServer server = new ProxyServer(4444);
try {
server.start();
} catch (Exception e) {
e.printStackTrace();
}
Proxy proxy = server.seleniumProxy();
proxy.setHttpProxy("xxx.xxx.xxx.xxx:4444");
server.setCaptureHeaders(true);
server.setCaptureContent(true);
server.newHar("Testpage");
@AfterSuite
HAR har = server.getHar();
try {
FileOutputStream fos = new FileOutputStream(strFilePath);
har.writeTo(fos);
server.stop();
}catch (Exception e) {
e.printStackTrace();
}
Can any one help me on this.