Skip to content

6. WebDriver LifeCyle

James Crocker edited this page Oct 20, 2016 · 2 revisions
  • Given the following TestNG suite XML example:
<suite name="myTest" preserve-order="true" parallel="none|tests|classes|methods">
  <test name="FirstVerify">
    <classes>
      <class name="com.sios.stc.coseng.tests.myWebApp.myFirstTest">
        <methods>
          <include name="verifyIt" />
          <include name="verifyItAgain" />
        </methods>
      </class>
      <class name="com.sios.stc.coseng.tests.myWebApp.mySecondTest">
        <methods>
          <include name="verifySomething" />
          <include name="verifySomethingAgain" />
        </methods>
      </class>
    </classes>
  </test>
  <test name="SecondVerify">
    <classes>
      <class name="com.sios.stc.coseng.tests.myWebApp.myThirdTest">
        <methods>
          <include name="verifyWhen" />
          <include name="verifyWhere" />
        </methods>
      </class>
      <class name="com.sios.stc.coseng.tests.myWebApp.myFourthTest">
        <methods>
          <include name="verifyWhat" />
          <include name="verifyWhy" />
        </methods>
      </class>
    </classes>
  </test>
</suite>
<style type="text/css"> .tg {border-collapse:collapse;border-spacing:0;border-color:#aabcfe;} .tg td{font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:#aabcfe;color:#669;background-color:#e8edff;} .tg th{font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:#aabcfe;color:#039;background-color:#b9c9fe;} .tg .tg-v4ss{background-color:#D2E4FC;font-weight:bold;vertical-align:top} .tg .tg-amwm{font-weight:bold;text-align:center;vertical-align:top} .tg .tg-9hbo{font-weight:bold;vertical-align:top} .tg .tg-yw4l{vertical-align:top} .tg .tg-6k2t{background-color:#D2E4FC;vertical-align:top} @media screen and (max-width: 767px) {.tg {width: auto !important;}.tg col {width: auto !important;}.tg-wrap {overflow-x: auto;-webkit-overflow-scrolling: touch;}}</style>
COSENG WebDriver Lifecycles per TestNG Parallel Mode
TestNG Parallel Mode COSENG WebDriver Start COSENG WebDriver Stop Notes
none|false @beginning of suite @end of suite One singular web driver is started. It is used and shared among all tests, classes and methods in the suite.
tests @beginning of each test @end of each test Two web drivers will be started. FirstVerify classes and included methods all use one and share web driver. SecondVerify classes and included methods all use and share another separate web driver. Each web driver is mutually exclusive of the other.
classes @beginning of each class @end of each class Four web drivers will be started. myFirstTest included methods will all use and share one web driver. mySecondTest included methods will all use and share another web driver. myThirdTest included methods will all use and share another separate web driver. And finally, myFourthTest included methods will use and share yet another web driver. Each web driver is mutually exclusive of the others.
methods @beginning of each method @end of each method Eight web drivers will be started. Each included method will be provided its own individual and separate web driver. Each of the eight web driver are mutually exclusive of the others.
none|false & COSENG Test oneWebDriver=true @start of TestNG execution @end of TestNG execution One web driver will be started. The singular web driver will be shared across and successively used by all tests, classes and included methods of all suites. OneWebDriver provides a means for end-to-end testing using composed suites of composed tests.
instances n/a n/a COSENG doesn't support this parallel mode
Clone this wiki locally