Popup handler (Pro edition)
Our solution: running a background process to handle popups, a simple and reliable approach. Here is how it works:
nid = notify_execution_monitor_before_basic_auth("bob", "builder") # prepare to handle basic authentication pop with username/password open_browser # it will ask for user to login (basic authentication popup) notify_execution_monitor_cancel(nid) #operation complete, test can continue, notify the handler
C:\Program Files\TestWise\scripts\execution_monitor> startup.bat
You will see the text below, indicating the background popup clicking process up running
[05-11 09:39:14PM] Starting RWebSpec Monitoring v(0.2.5) on 4208
Let's illustrate with an example. In TestWise, open samples\demo\demo.tpr project, select file popup_handler_test.rb, run it.
the test script:
For basic authentication, if somehow previous tests already created the session, the dialog won't be shown. The above test still works!
As different versions of IE might have popups with different titles, the execution monitor's target environment is IE8 on WinXP.
on Window 7
Prior to RubyShell v1.6.1, the AutoIt3, the library used to click buttons in popups, was not working well on Window 7 64-bit OS. An alternative approach is to use RAutomation's WinFFi adapter. You don't need to worry about this - just install RubyShell 1.6.1 or later version.
The steps are exactly the same, on starting the execution monitor, you get this:
Error no load AutoITX3 (not working on Win7), will use RAutomation instead [05-15 08:24:12AM] Starting RWebSpec Monitoring v(0.2.6) on 4208
Here is a screencast of Popup handler on Window 7