<xml version="1.0" xmlns="http://www.w3.org/2005/07/scxml">
<mscript>
	<mbt>
		<script type="MBT_start">
		</script>

		<script type="MBT_end">
			<!-- executed after MBT execution is completed, once per MBT execution -->
			<!-- for example, send out test completion notification -->
		</script>

		<script type="onException">
			<!-- executed when an exception is raised, executed for each exception -->
		</script>

		<script type="onError">
			<!-- executed on any runtime error -->
		</script>
	</mbt>

	<state id="ProductList">
		<script type="onentry">
			<!-- executed at the entry to this state -->
		</script>

		<script type="onexit">
			<!-- executed after the transition event action script of this state has been executed -->
			<!-- for example, advance the test data set to the next row -->
		</script>

		<transition event="AddItem">
			<script type="prep">
				<!-- executed before the action script of this transition -->
				<!-- for example, set the fields on the screen from the current test data set -->
			</script>

			<script type="action">
				<!-- executed right after prep script, causing the transition from current state to the next -->
				<!-- for example, click on a link, button or an area on the map -->
				<!-- action code="click(xpath=//a[@name='addItem1'])" /-->
			</script>

			<script type="verify">
				<!-- executed after onentry script of next state. -->
				<!-- for example, assert certain fields on screen have the correct values (static value or against database) -->
			</script>
		</transition>

		<transition event="ShowShoppingCart">
			<script type="prep">
			</script>

			<script type="action">
			</script>

			<script type="verify">
			</script>
		</transition>

		<transition event="Checkout">
			<script type="prep">
			</script>

			<script type="action">
			</script>

			<script type="verify">
			</script>
		</transition>
		
		<transition event="ViewDetail">
			<script type="prep">
			</script>

			<script type="action">
			</script>

			<script type="verify">
			</script>
		</transition>
	</state>

	<state id="ShoppingCart">
		<script type="onentry">
		</script>

		<script type="onexit">
		</script>

		<transition event="Update">
			<script type="prep">
			</script>

			<script type="action">
			</script>

			<script type="verify">
			</script>
		</transition>

		<transition event="ContinueShopping">
			<script type="prep">
			</script>

			<script type="action">
			</script>

			<script type="verify">
			</script>
		</transition>

		<transition event="Order">
			<script type="prep">
			</script>

			<script type="action">
			</script>

			<script type="verify">
			</script>
		</transition>

		<transition event="RemoveItem">
			<script type="prep">
			</script>

			<script type="action">
			</script>

			<script type="verify">
			</script>
		</transition>
	</state>

	<state id="ProductDetail">
		<script type="onentry">
		</script>

		<script type="onexit">
		</script>
		<transition event="ContinueShopping">
			<script type="prep">
			</script>

			<script type="action">
			</script>

			<script type="verify">
			</script>
		</transition>

		<transition event="ShoppingCart">
			<script type="prep">
			</script>

			<script type="action">
			</script>

			<script type="verify">
			</script>
		</transition>
		
	</state>

	<state id="Checkout">
		<script type="onentry">
		</script>

		<script type="onexit">
		</script>

		<transition event="ContinueShopping">
			<script type="prep">
			</script>

			<script type="action">
			</script>

			<script type="verify">
			</script>
		</transition>

		<transition event="Pay">
			<script type="prep">
			</script>

			<script type="action">
			</script>

			<script type="verify">
			</script>
		</transition>

		<transition event="CalcShipping">
			<script type="prep">
				<action code="type('id=visaNum','1234567890')"/>
				<action code="selectOption('shippingMethod','value=FEDEX')"/>
			</script>

			<script type="action">
				<action code="click('calcShipping')" />
			</script>

			<script type="verify">

			</script>
		</transition>
		
		<transition event="ShowShoppingCart">
			<script type="prep">
			</script>

			<script type="action">
			</script>

			<script type="verify">
			</script>
		</transition>
		
		<transition event="TestAlert">
			<script type="prep">
			</script>

			<script type="action">
			</script>

			<script type="verify">
			</script>
		</transition>

	</state>

	<state id="ThankYou">
		<script type="onentry">
		</script>

		<script type="onexit">
		</script>

		<transition event="ContinueShopping">
			<script type="prep">
			</script>

			<script type="action">
			</script>

			<script type="verify">
			</script>
		</transition>

	</state>

</mscript>
<doc>
	This is the generated MBT mScript file from MBT model WebStore
	Save this file to script/ folder with name WebStore.xml
	The following are additional examples of mscript tags and commands. 
	For more information about mscript, visit www.optimalMBT.com/support. 
	<dataset id="customerList" autorewind="true">
		<rowdata>
			<field id="lastName" value="Smith"/>
			<field id="customerNum" value="12345" />
		</rowdata>
	</dataset>
	<rewind dataset="customerList" />
	<assert value1="getValue('id=lastName')" op="eq" value2="getData('customerList:lastName')" else="L2: wrong customer lastName" />
	<while value1="getData('customerList:lastName')" op="ne" value2="getVar('curCustomerLastName')" >
		<next dataset="customerList" />
		<if value1="getDataRowNum('customerList')" op="ge" value2="100">
			<log message='found the customer' level='info' />
		</if>
	</while>
	<action code="click('id=googleSearchLink')" />
	<action code="osCmd('sendMail.bat from=abc@myco.com to=myFriend@yahoo.com sub=webMBT message=MBT-is-a-lot-of-fun')" />
	<set var="_customerNumr" value="getData('customerList:customerNum')" />
</doc>
</xml>

