There is a pop-up which comes randomly .I want to handle it using If..then..Else st and not Recovery Scenario since this is not working .
The nature of pop-up is such that,it automatically dissappears after 30-40 secs. But I don't want to wait that long.It would be good if there was an If..st. which will click 'OK' on the pop-up as soon as it pops-up.if not,proceed to the next step.
Does it come in the same place in your script each time?
if so then you want:
</font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">if Browser("Intranet Word".Dialog("Microsoft Internet".exist(5) then
Browser("Intranet Word".Dialog("Microsoft Internet".winbutton("OK".click
end if</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">the 5 after the exist above is how long to wait for this dialog box to appear. if you leave it blank it will default to the default test setting which, IIRC is 20 secs by default.
I'm not a complete idiot - some parts are missing.
Optional Steps as the name suggest are steps that may or not occur while running a scenario. If you specify a step as optional and QTP is not able to execute that step then it will procced to next step and it will not log a failure in the test results also.
And when "chillyhouse52556" says it time cosuming that means QTP waits for certain time to try n excute that optional step. if that step occurs the response would be fast but if it does not occur then you will some delays in your script