Hi, is there a way to tell my web app not to display fullscreen ads like these?
These ads appear randomly after clicking a link to one of our subpages. Closing these kind of ads through automated testing (locate element and click) appears to be very difficult, because there are many types of ads that can be closed differently.
Can you please share which Selenium supported language you are using for implementation? Sharing two options as per my experience with Selenium:
Recursively Closing Child Windows (or AD Windows)
Is it possible for you to recursively close the windows (using the Window Handles) till the time there is only one window open (which is the parent window)? With such a solution, even if a new AD window(s) pops-up, closing the window(s) will lead you to the Parent Window.
I have written a blog on a similar topic (involving annoying pop-ups) where I have demonstrated how to recursively close the windows (except the Parent Window). Attaching the code (from the above mentioned blog that has implementation in PHP with Selenium).