Fires a custom event.QTP-fireevent

Syntax –

Behavior.fireEvent(sEvent[, oEvent])

Example –

The following partial script component is derived from a calculator script component sample. Whenever the result changes, the script component fires a custom onResultChange event back to the page, passing the result as an expando property of the event object.

<event name="onResultChange" />

<implements type="Behavior">
<attach event="onclick" handler="doCalc");

<script language="JScript">
function doCalc(){
// Code here to perform calculation. Results are placed into
// the variable sResult.

oEvent = createObjectEvent();
oEvent.result = sResult;