TestOptimal Wiki

Model-Based Testing (MBT)

User Tools

Site Tools


seqout_java

seqout tag allows you to turn system generated test sequence to java code or VBA script or whatever programming language you wish.

Below is an example of mScript to generate a java code that calls Selenium API to perform the testing when the transition is traversed.

<state id=“login”>

 <transition id="bLogin">
   <script type="action">
     <seqout>
       <output>
         this.getSeleniumSession().type("id=userid", "$getData('loginUserID')");
         this.getSeleniumSession().click("id=password", "$getData('loginPassword')");
         this.getSeleniumSession().click("id=bLogin");
       </output>
     </seqout>
   </script>
 </transition>

</state>

The above mScript generates the following java code when the transition “bLogin” is traversed:

  this.getSeleniumSession().type("id=userid", "tst01");
  this.getSeleniumSession().click("id=password", "xyz");
  this.getSeleniumSession().click("id=bLogin");

where “tst01” and “xyz” were obtained from the variables “loginUserID” and “loginPassword” respectively.

seqout_java.txt · Last modified: 2016/09/22 02:36 (external edit)