java – Webdriver showModalDialog
We use webdriver for functional testing However, our application uses the showModalDialog JS function to open a pop-up window When we try to test this feature using webdriver, it hangs when the pop-up window opens
We tried several ways to test it:
>Use here to explain the solution But this seems to be a fix for selenium, not webriver We tried, but it didn't work. > Find a good alternative. Htmlunit opens the Mode dialog box and can interact with it, but it has some disadvantages, such as no visual help to fix some tests. When it detects JS errors in the JS library we must use, it stops execution but cannot control
How do we test this or solve this problem?
Solution
According to my experience in using various automation tools, I use window Showmodaldialog() or window Showmodelessdialog() the Web dialog window opened from IE is not available
Because the window is not a "real" window (view the taskbar, it doesn't even display), most tools can't "check" it and / or interact with it
But if you do find a tool to use, please advise - there are many people looking for such beasts
In a word, if you can avoid using either of these two proprietary methods, you will get more luck
(yes, for those who are picky, Firefox and chrome have adopted this dialog box, but they don't work exactly the same.)