I am working on Bookmark creation in the browsers.
When i try open different urls suddenly some of Popup's coming in between like "security popups","adds" etc.Because of which script failing.
So please tell me how to handle those popups at runtime.
and also please note that we don't when those popups will appear.So we have to set the globally to handle these ups.
Please help me in handling these type of popup's
I don't know exactly, however, try to use parallel thread to check when popup window will open and just close it.
Or check when your main browser window doesn't have got focus for some time, and check which window is active in that time and close it.
Or during all your script check size of browser window, if it will be small - it is popup.
Hope, my ideas will be useful for you!
Software Engineer in Test Automation, Ukraine
See help for SetTrap and ClearTrap methods. For dialog boxes it is the best solution you are looking for
The ideas given by u are good, but can u give an example, for creating a parallel thread on a single machine where my script present.
I have gone through the help for SetTrap and Clear Trap and wrote the follwing code.
For handling Security Alert, i wrote the following,
[-] TestCaseEnter ()
[ ] SecurityAlert.SetTrap("OK")
[ ] SetAppState ()
[-] TestCaseExit (BOOLEAN bException)
[ ] SecurityAlert.ClearTrap()
[+] if (bException)
[ ] ExceptLog ()
[ ] SetBaseState ()
Here i am hanling the SetTrap and Clear Trap because i need to check in each and every test case.
I tried like this, but it is not working fine i.e. it is not handling popup's.
Please let me know if anybody have other ideas top handle these popups.
Thanks & Regards
To handle popup blocks that occur atr runtime we can do something like as follows...
1. Declare a popup window in any framework file.
2. Write a method under this window declaration let's say method can be Dismiss().
window BrowserChild PopupBlocker
Here write a code using some globally declared variables tht represents time in m.sec and check for the existance of PopupBlocker if in case exists make the browser to wait for few sec.s
Now u can use PopupBlocker.Dismiss() wherever u want like during loading of URL etc..
How do we handle Microsoft I.E popups.
Thanks in advance for your help.