Running selenium test multiple times in testng -


I have a suite that has a test with many classes. I need to run this suit several times (not in parallel). In other words, "firefoxestes" tests run 300 times or 1000 times, etc. I know how it uses junit to work, but I do not use testng which has been converted into my script now. Here is my XML file:

  & lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt ;! DOCTYPE Suite System "http://testng.org/testng-1.0.dtd"> & Lt; Suite name = "Suitendoind" parallel = "wrong" verbose = "10" thread-count = "2" & gt; & Lt; Listeners & gt; & Lt; Audience category-name = "com.bpms.tests.MySuiteListener" /> & Lt; / Listeners & gt; & Lt; test name = "FirefoxTests" & gt; & Lt; Parameter name = "browser" value = "firefox" /> & Lt; Classes & gt; & Lt; Class name = "com.bpms.tests.InitiateBuyPlan" /> & Lt; class name = "com.bpms.tests.AddItemsToBuyPlan" /> & Lt; Class name = "com.bpms.tests.ReviewBuyPlan" /> & Lt; Class name = "com.bpms.tests.ApproveBuyPlan" /> & Lt; Class name = "com.bpms.tests.ManageQuoteSolicitation" /> & Lt; class name = "com.bpms.tests.StartQuote" /> & Lt; Class name = "com.bpms.tests.ReviewQuote" /> & Lt; Class name = "com.bpms.tests.RecordInterestInQuotes" /> & Lt; Class name = "com.bpms.tests.ReviewCountryBuyIn" /> & Lt; Class name = "com.bpms.tests.CompleteItemInfo" /> & Lt; Class name = "com.bpms.tests.ReviewItemInformation" /> & Lt; Class name = "com.bpms.tests.UpdateInterestInQuote" /> & Lt; Class name = "com.bpms.tests.PerformLogisticsAnalysis" /> & Lt; Class name = "com.bpms.tests.SecondReview" /> & Lt; Class name = "com.bpms.tests.ReviewNLCDiagrams" /> & Lt; class name = "com.bpms.tests.ConfirmItemSpecifications" /> & Lt; Class name = "com.bpms.tests.ClassifyItem" /> & Lt; Class name = "com.bpms.tests.ApproveItem" /> & Lt; Class name = "com.bpms.tests.ClassifyItem2" /> & Lt; Class name = "com.bpms.tests.CompleteItemClassification" /> & Lt; Class name = "com.bpms.tests.ApproveItemClassification" /> & Lt; class name = "com.bpms.tests.SubmitLinkToFreightEstimates" /> & Lt; Class name = "com.bpms.tests.ReviewFreightWorksheet" /> & Lt; class name = "com.bpms.tests.ReviewItemInfoAndReviseInterest" /> & Lt; Category name = "com.bpms.tests.ManageAnalyzedQuotes" /> & Lt; Class name = "com.bpms.tests.AuthorizeItemDevelopment" /> & Lt; Class name = "com.bpms.tests.ConcilateCountryAuthorizations" /> & Lt; Class name = "com.bpms.tests.FinalizeItemInformationAndGenerateUnsignedItemAgreementPDF" /> & Lt; Class name = "com.bpms.tests.VerifyAndUploadItemDocuments" /> & Lt; class name = "com.bpms.tests.AttachDocsForApproval" /> & Lt; class name = "com.bpms.tests.FinalizeItemForApproval" /> & Lt; class name = "com.bpms.tests.ApproveItemGMM" /> & Lt; Class name = "com.bpms.tests.ConolidateInCountryAGMM_GMMResponses" /> & Lt; Class name = "com.bpms.tests.InitiateCodeOfConductForFactory" /> & Lt; Class name = "com.bpms.tests.SubmitAuditResultsForFactory" /> & Lt; Class name = "com.bpms.tests.ConfirmItemSetupAndPOsIssued" /> & Lt; Class name = "com.bpms.tests.VerifyReceiptsOfPOs" /> & Lt; Class name = "com.bpms.tests.ConfirmReceiptOfPOs" /> & Lt; Class name = "com.bpms.tests.ReviewQAProductionTestResults" /> & Lt; Class name = "com.bpms.tests.CompleteProjectChecklist" /> & Lt; Class name = "com.bpms.tests.VerifySupplierCodeOfConductForFactory" /> & Lt; Class name = "com.bpms.tests.VerifyChainSecurityForFactory" /> & Lt; / Sections & gt; & Lt; / Test & gt; & Lt ;! - FirefoxTests - & gt; & Lt; / Suits & gt; & Lt ;! - Suitendoand - & gt; There is no direct route to XML, but in a way it can be done easily. In order to write an implementation for ITestListener without actually adding too much effort    

In the OnStart method, you can set the invention calculation for all the methods in the test. For example:

  public debate onStart (ITestContext reference) {if (context.getName (). Equals ("FFTests")) {for (ITestNGMethod found: context.getAllTestMethods ()) { Met.setInvocationCount (200); }}}   

If the same suite should be done at the level, then apply the same login listener on the start method.

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -