By Changing the Internet Options in your browser we avoided few pop-ups. And for few we declared odjects derived from dialog box and handled through our code. If you cahnge the Security level and add few trusted sites in browser you can also avoid few.
You need to figure out why you are getting ad popups. Is it because your browser has a home page with ads? Does the page you are testing have popup ads?
Regarding the other popups (security warnings, autocomplete, etc.):
* you can get rid of some by adjusting your security settings as Sreekanth suggests
* you can get rid of more by installing the root certificate for the site you are testing locally
* all others will appear when you change pages or load the first page. therefore, you can add code that checks for popups when you call Browser.LoadPage() or whenever you transition pages.
Keep in mind that you will need to add sleep() calls into your script to avoid trying to move through popups too quickly. I also recommend using a 'latch' for all popups:
</font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">int catchTries
if (catchTries < 10)
LogError ("Never caught dialog"
break</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">
Chris R Mead
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
first thing is disabling popups, and if you want to do it through SilkTest: You could keep on looking for dialogs and close them if exists. If the dialogs are created as childs of the browser window(child windows of AUT) you can use Browser.CloseWindows () method to close all the child windows.
If they are independent dialogs a set active for your browse window would do want you want.
If the dialog appearing is unique (not having the same attributes as some other dialogs that you may want to test for the AUT) then you can use SetTrap method to trap your dialog.
Look for settrap method in help file and you will get more details.