简体   繁体   中英

Selenium - Handling modal (Child Browser) window in Microsoft Dynamics CRM

I am trying automate Microsoft Dynamics CRM application using Selenium RC, I am unable to handle the modal(child browser) windows. Every time Selenium clicks to open modal window ( selenium.selectWindow("windowName") ) I am getting the following error.

There was an unexpected Alert! [A Microsoft Dynamics CRM window was unable to open, and may have been blocked by a pop-up blocker. Please add this Microsoft Dynamics CRM server to the list of sites your pop-up blocker allows to open new windows:

As per the research I tried to add the sever site to trusted sites and also added the site to popup blocker allow list but no gains.

Please direct to me right way of handling it

What you can do is accept the popups in the Internet Security, and un-mark the Browse in Secure mode . Close your browser.

Then try it in FireFox and after that do it in Internet Explorer again.

For some reason Microsoft Dynamics CRM thinks it cannot open the popup window, so it wants to show an alert indicating that. Selenium sees the alert and since it is not expected (you didn't call getAlert() ), so the next selenium action (which is selecting the window if I understand correctly) fails.

Maybe you need to wait for the window to actually appear before selecting it?

Check what happens if you set a breakpoint just before the selectWindow() and step through it.

Also try the same steps manually. Do they work?

Remember that selenium uses its own default profile for browsers, so your popup blocker settings may not get through. Which browser is this?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM