I have tested against an web app that had a shockwave type ad popup appear but was not a regular occurence for that particular page, so i used the 'OptionalStep'because the id of the popup frame didn't change. On another page the same thing would happen but it was a matter of functionality would cease until the pop up appeared so I used a 'sync' and then later on used a WaitProperty method to ensure that my script wouldn't fail. However I'm fairly sure your issue is not exactly as easy as that. (Apologies as i know what i meant but didn't actually type it that way...) [img]images/icons/smile.gif[/img]
Hi juleo...u r absolutely correct that as its a part of the business flow i cannot close it using code....and its not a good code to give Sync or wait after nearly each and every lines of code...hence i am looking some generic solution.......
If it is expected Pop up window then u can make generic fucntion where u can pass the Dialog window,and put some wait also.
Use this function, for fetching the message and closing the window also.
Function CheckDlgMessage(objDialog,strExpectedMessage,strSt epNumber)
strActualMsg = objDialog.GetVisibleText()
strActualMsg = Trim(strActualMsg)
nIndex = instr(1,strActualMsg,strExpectedMessage,1)
If (instr(strActualMsg,strExpectedMessage) > 0) Then
Reporter.ReportEvent micPass,strStepNumber,"The Message matches. The Message is: " & strExpectedMessage
strReportString = "The Message does not matches. Expected Message is: " &vbcr &strExpectedMessage &vbcr + "Actual Message is: " & strActualMsg
Reporter.ReportEvent micFail,strStepNumber,"" &strReportString