Site MapAccessibilityContact Us

Call us at (855) 254-1164 to learn more about Enterprise

PushToTest - Open Source Test

Welcome, Guest
Please Login or Register.    Lost Password?
Forum is locked
Getting TPS when using Java/HTMLUnit Tests in PTT Forum is locked
(1 viewing) (1) Guest
Writing unit tests in Java, Jython, PHP, Perl, Ruby for operation in TestMaker
Go to bottomPage: 1
TOPIC: Getting TPS when using Java/HTMLUnit Tests in PTT
#383
Getting TPS when using Java/HTMLUnit Tests in PTT 2 Years, 1 Month ago Karma: 0
We desinged a Java test based on SeleniumHtmlunit library. This test work fine when launch as a functionnal test.

The test also work when it is launched as Load And Preformance Test but the PTT see\'s the whole test as a unique transaction. At the end of the test I obtain a graph that indicate 0.0008 TPS
Is there a way to specify to PTT what is a transaction in the Java Code itself.

Here is a fragment of the code:

public class PanoramaHTMLUnitTestsBaseTechno extends HTMLUnitTestBase {
...
public void testLoginFR(String[] args) throws Exception {
for (int i = 0; i < args.length;i++){
switch (i) {
case 0:
destURL = args[i];
break;
case 1:
userName = args[i];
break;
case 2:
password = args[i];
break;
}
}
assertNotNull(\"Aucune destination n\'a été spécifié\", destURL);
assertTrue(\"La destination est invalide\", destURL.length() > 0);
assertNotNull(\"Aucun ID utilisateur n\'a été spécifié\", userName);
assertTrue(\"ID utilisateur invalide\", userName.length() > 0);
assertNotNull(\"Aucun mot de passe n\'a été spécifié\", password);
assertTrue(\"La mot de passe est invalide\", password.length() > 0);

//super.selenium.setSpeed(\"2000\");
try {
super.selenium.getSelenium().setBaseUrl(destURL);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
user = new PanoramaUser(userName, password);
panoramaTestHelper.setLang(PanoramaTestHelper.LANG_FR);
panoramaTestHelper.loginToPanoramaDashboard(user.getUserID(), user.getPassword());
}
...
}
public class PanoramaHTMLUnitTestHelper {
...
public void loginToPanorama(String username, String password){
SeleniumHtmlunit selenium = tester.getSelenium();
if (selenium == null)
return;
try {
selenium.open(URL_PANORAMA);
int waittime = 0;
while (!selenium.isElementPresent(\"//input[@type=\'text\']\")){
if (waittime > 10)
return;
System.out.println(\"Waiting...\");
selenium.pause(\"3000\");
selenium.open(URL_PANORAMA);
}

selenium.type(\"//input[@type=\'text\']\", username);
selenium.type(\"//input[@type=\'password\']\", password);
// Bouton connexion
selenium.click(\"//body[@id=\'gupsBody\']/table/tbody/tr[2]/td[2]/div/table/tbody/tr[4]/td/table/tbody/tr/td[1]/table/tbody/tr/td[2]/div/div\");
//selenium.waitForPopUp(null, \"30000\");
selenium.waitForPageToLoad(\"60000\");
selenium.open(URL_PANORAMA);
selenium.waitForPageToLoad(\"60000\");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

}
...
}

Here is the Load Test:
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!--
PushToTest(tm) Test Scenario for a load test

PushToTest is the open-source application performance management (APM)
and test automation platform.

For technical support, documentation, and help see www.pushtotest.com
-->
<testscenario xmlns=\"www.pushtotest.com/tm5\" xmlns:xsi=\"www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"www.pushtotest.com/XSD/testscenario.xsd\" version=\"2.0\">
<basics>
<name>SIPMITestsTechno</name>
<defaultdirectory>{scenario}</defaultdirectory>
</basics>
<testnodes>
<node name=\"localhost\" location=\"localhost:8082/TestNetwork/ws/TestNode\" monitor=\"localhost:51111\"/>
</testnodes>
<DataSources/>
<resources>
<jar path=\"/root/Tests/SIPMITestsFonctionnels.jar\"/>
</resources>
<loadtest>
<testusecase>
<dimensions>
<crlevels>
<crlevel value=\"2\"/>
<crlevel value=\"4\"/>
<crlevel value=\"8\"/>
</crlevels>
<setup name=\"prepare\" method=\"prepare\" testclass=\"ca.qc.inspq.tests.panorama.commun.PanoramaHTMLUnitTestsBaseTechno\" module=\"jar:/root/Tests/SIPMITestsFonctionnels.jar\" instance=\"inst1\" langtype=\"java\">
<argument name=\"args\" value=\"servertotest\"/>
<argument name=\"args\" value=\"username\"/>
<argument name=\"args\" value=\"password\"/>
</setup>
<usecases>
<usecase name=\"TestsTechno\">
<sequence name=\"TestsTechno\" proportion=\"100\">
<test>
<run name=\"LoginFR\" method=\"testLoginFR\" testclass=\"ca.qc.inspq.tests.panorama.commun.PanoramaHTMLUnitTestsBaseTechno\" module=\"jar:/root/Tests/SIPMITestsFonctionnels.jar\" instance=\"inst1\" langtype=\"java\">
<argument name=\"args\" value=\"http:servertotest\"/>
<argument name=\"args\" value=\"username\"/>
<argument name=\"args\" value=\"passord\"/>
</run>
<run name=\"AdminFR\" method=\"testAdminFR\" testclass=\"ca.qc.inspq.tests.panorama.commun.PanoramaHTMLUnitTestsBaseTechno\" module=\"jar:/root/Tests/SIPMITestsFonctionnels.jar\" instance=\"inst1\" langtype=\"java\"/>
<run name=\"ReportsFR\" method=\"testReportsFR\" testclass=\"ca.qc.inspq.tests.panorama.commun.PanoramaHTMLUnitTestsBaseTechno\" module=\"jar:/root/Tests/SIPMITestsFonctionnels.jar\" instance=\"inst1\" langtype=\"java\"/>
<run name=\"GPIFR\" method=\"testGPIFR\" testclass=\"ca.qc.inspq.tests.panorama.commun.PanoramaHTMLUnitTestsBaseTechno\" module=\"jar:/root/Tests/SIPMITestsFonctionnels.jar\" instance=\"inst1\" langtype=\"java\"/>
<run name=\"InvestigationsFR\" method=\"testInvestigationsFR\" testclass=\"ca.qc.inspq.tests.panorama.commun.PanoramaHTMLUnitTestsBaseTechno\" module=\"jar:/root/Tests/SIPMITestsFonctionnels.jar\" instance=\"inst1\" langtype=\"java\"/>
<run name=\"OutbreaksFR\" method=\"testOutbreaksFR\" testclass=\"ca.qc.inspq.tests.panorama.commun.PanoramaHTMLUnitTestsBaseTechno\" module=\"jar:/root/Tests/SIPMITestsFonctionnels.jar\" instance=\"inst1\" langtype=\"java\"/>
<run name=\"WorkMgtFR\" method=\"testWorkMgtFR\" testclass=\"ca.qc.inspq.tests.panorama.commun.PanoramaHTMLUnitTestsBaseTechno\" module=\"jar:/root/Tests/SIPMITestsFonctionnels.jar\" instance=\"inst1\" langtype=\"java\"/>
<run name=\"DocMgtFR\" method=\"testDocMgtFR\" testclass=\"ca.qc.inspq.tests.panorama.commun.PanoramaHTMLUnitTestsBaseTechno\" module=\"jar:/root/Tests/SIPMITestsFonctionnels.jar\" instance=\"inst1\" langtype=\"java\"/>
<run name=\"LogoutFR\" method=\"testLogoutFR\" testclass=\"ca.qc.inspq.tests.panorama.commun.PanoramaHTMLUnitTestsBaseTechno\" module=\"jar:/root/Tests/SIPMITestsFonctionnels.jar\" instance=\"inst1\" langtype=\"java\"/>
</test>
</sequence>
</usecase>
</usecases>
<teardown name=\"cleanUp\" method=\"cleanUp\" testclass=\"ca.qc.inspq.tests.panorama.commun.PanoramaHTMLUnitTestsBaseTechno\" module=\"jar:/root/Tests/SIPMITestsFonctionnels.jar\" instance=\"inst1\" langtype=\"java\">
<argument name=\"args\" value=\"servertotest\"/>
<argument name=\"args\" value=\"username\"/>
<argument name=\"args\" value=\"password\"/>
</teardown>
</dimensions>
</testusecase>
</loadtest>
<logs showsummary=\"false\" step=\"true\"/>
<monitoring enablednodes=\"true\" enabledtarget=\"true\">
<host name=\"appserver\" location=\"appserver:51111\">
<glassbox enabled=\"false\">
<filter/>
</glassbox>
</host>
</monitoring>
<notifications/>
<options>
<sleeptime>0000</sleeptime>
<delayBetweenStartingUseCases time=\"10000\"/>
<delayBetweenTestCases time=\"1000\"/>
<testTime time=\"120000\"/>
<htmlunit DebuggingWebConnection=\"false\" HtmlUnitContextFactory=\"false\" xmltestresultimpl=\"false\" csswarning=\"false\" jswarning=\"false\" version=\"2.9.1800\"/>
<selenium throwExceptionOnScriptError=\"true\" loglevel=\"INFO\" throwExceptionOnFailingStatusCode=\"true\"/>
<proxy/>
</options>
<chart samples=\"1\" usedatacompression=\"false\"/>
</testscenario>
elfelip
Fresh Boarder
Posts: 5
graphgraph
User Offline Click here to see the profile of this user
Last Edit: 2011/04/15 07:20 By elfelip.
The topic has been locked.
 
#401
Re: Getting TPS when using Java/HTMLUnit Tests in PTT 2 Years, 1 Month ago Karma: 3
You can use PTTStepListener as below:

It is available under com.pushtotest.tool.PTTStepListener


PTTStepListener.startStep( \"Type userName\" );


selenium.type(\"//input[@type=\'text\']\", username);
PTTStepListener.endStep();

Repeat the above for each command to get a details TPS.
Eshita
Gold Boarder
Posts: 194
graph
User Offline Click here to see the profile of this user
The topic has been locked.
 
#402
Re: Getting TPS when using Java/HTMLUnit Tests in PTT 2 Years, 1 Month ago Karma: 1
Hi,

I can see all are running under single test case.Could you please let me know the results using different test case.If test will run fine without failing then i can debug more this issue to achieve your requirement.

Thank you.
venu
Senior Boarder
Posts: 44
graphgraph
User Offline Click here to see the profile of this user
The topic has been locked.
 
#418
Re: Getting TPS when using Java/HTMLUnit Tests in PTT 2 Years, 1 Month ago Karma: 0
Thankyou.

The PTTStepLitener work realy fine for our needs. I can optains measures (min, max and avg) for all the transaction I identified in my test java code. I had to make some modifications on my scenario too. It Looks like this now.

<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!--
PushToTest(tm) Test Scenario for a load test

PushToTest is the open-source application performance management (APM)
and test automation platform.

For technical support, documentation, and help see www.pushtotest.com
-->
<testscenario xmlns=\"www.pushtotest.com/tm5\" xmlns:xsi=\"www.w3.org/2001/XMLSchema-instance\" version=\"2.0\" xsi:schemaLocation=\"www.pushtotest.com/XSD/testscenario.xsd\">
<basics>
<name>SIPMITestsTechno</name>
<defaultdirectory>{scenario}</defaultdirectory>
</basics>
<testnodes>
<node name=\"localhost\" location=\"localhost:8082/TestNetwork/ws/TestNode\" monitor=\"localhost:51111\"/>
</testnodes>
<DataSources/>
<resources>
<jar path=\"/root/Tests/SIPMITestsFonctionnels.jar\"/>
</resources>
<loadtest>
<testusecase>
<dimensions>
<crlevels>
<crlevel value=\"2\"/>
<crlevel value=\"4\"/>
<crlevel value=\"8\"/>
</crlevels>
<setup name=\"prepare\" method=\"prepare\" testclass=\"ca.qc.inspq.tests.panorama.commun.PanoramaHTMLUnitTestsBaseTechno\" module=\"jar:/root/Tests/SIPMITestsFonctionnels.jar\" instance=\"inst1\" langtype=\"java\">
<argument name=\"args\" value=\"server\"/>
<argument name=\"args\" value=\"username\"/>
<argument name=\"args\" value=\"password\"/>
</setup>
<usecases>
<usecase name=\"Admin\">
<sequence name=\"Admin\" proportion=\"20\">
<setup name=\"LoginFR\" method=\"testLoginFR\" testclass=\"ca.qc.inspq.tests.panorama.commun.PanoramaHTMLUnitTestsBaseTechno\" module=\"jar:/root/Tests/SIPMITestsFonctionnels.jar\" instance=\"inst1\" langtype=\"java\">
<argument name=\"args\" value=\"server\"/>
<argument name=\"args\" value=\"username\"/>
<argument name=\"args\" value=\"password\"/>
</setup>
<test>
<run name=\"AdminFR\" method=\"testAdmin\" testclass=\"ca.qc.inspq.tests.panorama.commun.PanoramaHTMLUnitTestsBaseTechno\" module=\"jar:/root/Tests/SIPMITestsFonctionnels.jar\" instance=\"inst1\" langtype=\"java\"/>
</test>
<teardown name=\"LogoutFR\" method=\"testLogout\" testclass=\"ca.qc.inspq.tests.panorama.commun.PanoramaHTMLUnitTestsBaseTechno\" module=\"jar:/root/Tests/SIPMITestsFonctionnels.jar\" instance=\"inst1\" langtype=\"java\"/>
</sequence>
<sequence name=\"Report\" proportion=\"10\">
<setup name=\"LoginFR\" method=\"testLoginFR\" testclass=\"ca.qc.inspq.tests.panorama.commun.PanoramaHTMLUnitTestsBaseTechno\" module=\"jar:/root/Tests/SIPMITestsFonctionnels.jar\" instance=\"inst1\" langtype=\"java\">
<argument name=\"args\" value=\"server\"/>
<argument name=\"args\" value=\"username\"/>
<argument name=\"args\" value=\"password\"/>
</setup>
<test>
<run name=\"ReportsFR\" method=\"testReports\" testclass=\"ca.qc.inspq.tests.panorama.commun.PanoramaHTMLUnitTestsBaseTechno\" module=\"jar:/root/Tests/SIPMITestsFonctionnels.jar\" instance=\"inst1\" langtype=\"java\"/>
</test>
<teardown name=\"LogoutFR\" method=\"testLogout\" testclass=\"ca.qc.inspq.tests.panorama.commun.PanoramaHTMLUnitTestsBaseTechno\" module=\"jar:/root/Tests/SIPMITestsFonctionnels.jar\" instance=\"inst1\" langtype=\"java\"/>
</sequence>
<sequence name=\"GPI\" proportion=\"30\">
<setup name=\"LoginFR\" method=\"testLoginFR\" testclass=\"ca.qc.inspq.tests.panorama.commun.PanoramaHTMLUnitTestsBaseTechno\" module=\"jar:/root/Tests/SIPMITestsFonctionnels.jar\" instance=\"inst1\" langtype=\"java\">
<argument name=\"args\" value=\"server\"/>
<argument name=\"args\" value=\"username\"/>
<argument name=\"args\" value=\"password\"/>
</setup>
<test>
<run name=\"GPIFR\" method=\"testGPI\" testclass=\"ca.qc.inspq.tests.panorama.commun.PanoramaHTMLUnitTestsBaseTechno\" module=\"jar:/root/Tests/SIPMITestsFonctionnels.jar\" instance=\"inst1\" langtype=\"java\"/>
</test>
<teardown name=\"LogoutFR\" method=\"testLogout\" testclass=\"ca.qc.inspq.tests.panorama.commun.PanoramaHTMLUnitTestsBaseTechno\" module=\"jar:/root/Tests/SIPMITestsFonctionnels.jar\" instance=\"inst1\" langtype=\"java\"/>
</sequence>
<sequence name=\"Investigations\" proportion=\"10\">
<setup name=\"LoginFR\" method=\"testLoginFR\" testclass=\"ca.qc.inspq.tests.panorama.commun.PanoramaHTMLUnitTestsBaseTechno\" module=\"jar:/root/Tests/SIPMITestsFonctionnels.jar\" instance=\"inst1\" langtype=\"java\">
<argument name=\"args\" value=\"server\"/>
<argument name=\"args\" value=\"username\"/>
<argument name=\"args\" value=\"password\"/>
</setup>
<test>
<run name=\"InvestigationsFR\" method=\"testInvestigations\" testclass=\"ca.qc.inspq.tests.panorama.commun.PanoramaHTMLUnitTestsBaseTechno\" module=\"jar:/root/Tests/SIPMITestsFonctionnels.jar\" instance=\"inst1\" langtype=\"java\"/>
</test>
<teardown name=\"LogoutFR\" method=\"testLogout\" testclass=\"ca.qc.inspq.tests.panorama.commun.PanoramaHTMLUnitTestsBaseTechno\" module=\"jar:/root/Tests/SIPMITestsFonctionnels.jar\" instance=\"inst1\" langtype=\"java\"/>
</sequence>
<sequence name=\"Outbreaks\" proportion=\"10\">
<setup name=\"LoginFR\" method=\"testLoginFR\" testclass=\"ca.qc.inspq.tests.panorama.commun.PanoramaHTMLUnitTestsBaseTechno\" module=\"jar:/root/Tests/SIPMITestsFonctionnels.jar\" instance=\"inst1\" langtype=\"java\">
<argument name=\"args\" value=\"server\"/>
<argument name=\"args\" value=\"username\"/>
<argument name=\"args\" value=\"password\"/>
</setup>
<test>
<run name=\"OutbreaksFR\" method=\"testOutbreaks\" testclass=\"ca.qc.inspq.tests.panorama.commun.PanoramaHTMLUnitTestsBaseTechno\" module=\"jar:/root/Tests/SIPMITestsFonctionnels.jar\" instance=\"inst1\" langtype=\"java\"/>
</test>
<teardown name=\"LogoutFR\" method=\"testLogout\" testclass=\"ca.qc.inspq.tests.panorama.commun.PanoramaHTMLUnitTestsBaseTechno\" module=\"jar:/root/Tests/SIPMITestsFonctionnels.jar\" instance=\"inst1\" langtype=\"java\"/>
</sequence>
<sequence name=\"WorkManagement\" proportion=\"10\">
<setup name=\"LoginFR\" method=\"testLoginFR\" testclass=\"ca.qc.inspq.tests.panorama.commun.PanoramaHTMLUnitTestsBaseTechno\" module=\"jar:/root/Tests/SIPMITestsFonctionnels.jar\" instance=\"inst1\" langtype=\"java\">
<argument name=\"args\" value=\"server\"/>
<argument name=\"args\" value=\"username\"/>
<argument name=\"args\" value=\"password\"/>
</setup>
<test>
<run name=\"WorkMgtFR\" method=\"testWorkMgt\" testclass=\"ca.qc.inspq.tests.panorama.commun.PanoramaHTMLUnitTestsBaseTechno\" module=\"jar:/root/Tests/SIPMITestsFonctionnels.jar\" instance=\"inst1\" langtype=\"java\"/>
</test>
<teardown name=\"LogoutFR\" method=\"testLogoutFR\" testclass=\"ca.qc.inspq.tests.panorama.commun.PanoramaHTMLUnitTestsBaseTechno\" module=\"jar:/root/Tests/SIPMITestsFonctionnels.jar\" instance=\"inst1\" langtype=\"java\"/>
</sequence>
<sequence name=\"DocManagement\" proportion=\"10\">
<setup name=\"LoginFR\" method=\"testLoginFR\" testclass=\"ca.qc.inspq.tests.panorama.commun.PanoramaHTMLUnitTestsBaseTechno\" module=\"jar:/root/Tests/SIPMITestsFonctionnels.jar\" instance=\"inst1\" langtype=\"java\">
<argument name=\"args\" value=\"server\"/>
<argument name=\"args\" value=\"username\"/>
<argument name=\"args\" value=\"password\"/>
</setup>
<test>
<run name=\"DocMgtFR\" method=\"testDocMgt\" testclass=\"ca.qc.inspq.tests.panorama.commun.PanoramaHTMLUnitTestsBaseTechno\" module=\"jar:/root/Tests/SIPMITestsFonctionnels.jar\" instance=\"inst1\" langtype=\"java\"/>
</test>
<teardown name=\"LogoutFR\" method=\"testLogout\" testclass=\"ca.qc.inspq.tests.panorama.commun.PanoramaHTMLUnitTestsBaseTechno\" module=\"jar:/root/Tests/SIPMITestsFonctionnels.jar\" instance=\"inst1\" langtype=\"java\"/>
</sequence>
</usecase>
</usecases>
<teardown name=\"cleanUp\" method=\"cleanUp\" testclass=\"ca.qc.inspq.tests.panorama.commun.PanoramaHTMLUnitTestsBaseTechno\" module=\"jar:/root/Tests/SIPMITestsFonctionnels.jar\" instance=\"inst1\" langtype=\"java\">
<argument name=\"args\" value=\"server\"/>
<argument name=\"args\" value=\"username\"/>
<argument name=\"args\" value=\"Pan0rama\"/>
</teardown>
</dimensions>
</testusecase>
</loadtest>
<logs showsummary=\"false\" step=\"true\"/>
<monitoring enablednodes=\"true\" enabledtarget=\"true\">
<host name=\"qlwas01t\" location=\"qlwas01t:51111\">
<glassbox enabled=\"false\">
<filter/>
</glassbox>
</host>
</monitoring>
<notifications/>
<options>
<sleeptime>0000</sleeptime>
<delayBetweenStartingUseCases time=\"10000\"/>
<delayBetweenTestCases time=\"1000\"/>
<maxrampdown time=\"60000\"/>
<testTime time=\"120000\"/>
<htmlunit DebuggingWebConnection=\"false\" HtmlUnitContextFactory=\"false\" xmltestresultimpl=\"false\" csswarning=\"false\" jswarning=\"false\" version=\"2.9.1800\"/>
<selenium throwExceptionOnScriptError=\"true\" loglevel=\"INFO\" throwExceptionOnFailingStatusCode=\"true\"/>
<proxy/>
</options>
<chart samples=\"1\" usedatacompression=\"false\">
<graph name=\"Transaction Distribution\" type=\"Lines\">
<XAxis value=\"Time\"/>
<YAxis value=\"Duration\"/>
<series>
<name>Transaction</name>
</series>
</graph>
</chart>
</testscenario>
elfelip
Fresh Boarder
Posts: 5
graphgraph
User Offline Click here to see the profile of this user
Last Edit: 2011/04/21 07:56 By elfelip.
The topic has been locked.
 
Go to topPage: 1