Firefox

22 views
Skip to first unread message

bullestock

unread,
Oct 26, 2011, 10:56:09 AM10/26/11
to Vapir
Hi,

I have started migrating some old test scripts from Selenium to Watir/
Vapir, and so far Vapir does seem to be the better of the two.

However: If I set

Vapir.config.default_browser = 'ie'

each test opens a new IE window as expected. But if I do

Vapir.config.default_browser = 'firefox'

then each test opens a new tab in the existing Firefox instance,
saying "Firefox can't establish a connection to the server at 9997".
This works fine in Watir, so what's the difference?

Ethan

unread,
Oct 26, 2011, 11:42:11 AM10/26/11
to va...@googlegroups.com
opening in a new tab is odd behavior. this is probably related to the 'open new windows in tabs' setting - see https://github.com/vapir/vapir/wiki/Browser-Settings
as for connecting, make sure you have the appropriate extension installed - mozrepl or jssh. 
To set Vapir to use MozRepl instead of JSSH, set the config key firefox_extension to "mozrepl"
If it's JSSH, you just need the extension installed, though you should still set the config firefox_extension to jssh as the default will be changing to mozrepl in the future. 
In either case, the browser should not be opened before you start your test, or the mozrepl or jssh server won't get started up. 

bullestock

unread,
Oct 27, 2011, 2:55:31 AM10/27/11
to Vapir
On Oct 26, 5:42 pm, Ethan <notet...@gmail.com> wrote:
> opening in a new tab is odd behavior. this is probably related to the 'open
> new windows in tabs' setting - seehttps://github.com/vapir/vapir/wiki/Browser-Settings
> as for connecting, make sure you have the appropriate extension installed -
> mozrepl or jssh.
> To set Vapir to use MozRepl instead of JSSH, set the
> config<https://github.com/vapir/vapir/wiki/Configuring-Vapir>key
> firefox_extension to "mozrepl".

Thanks. I resolved this issue by doing

Vapir::Firefox.config.firefox_profile = 'test'

I have one remaining problem: My test must click OK on a dialog box. I
know that the Firefox driver does not support set_text_field, so I
have this code:

modal = $browser.modal_dialog!
if $browserType != 'firefox'
modal.set_text_field(jobName)
end
modal.click_button('OK')

On IE, this works fine, but on Firefox I get

Vapir::Exception::NoMatchingWindowFoundException: No popup was
found on the browser

(And yes, the modal dialog is actually shown). BTW, I use the mozrepl
extension.

Ethan

unread,
Oct 27, 2011, 12:14:28 PM10/27/11
to va...@googlegroups.com
If you're on Firefox 4 or greater, you'll need to turn off tab-modal dialogs, as these aren't supported just yet. see https://github.com/vapir/vapir/wiki/Browser-Settings
  • (FF 4 and greater) Turn off tab-modal prompts. Go to about:config, find prompts.tab_modal.enabled and set it to false.

bullestock

unread,
Oct 28, 2011, 6:39:48 AM10/28/11
to Vapir
On Oct 27, 6:14 pm, Ethan <notet...@gmail.com> wrote:
> If you're on Firefox 4 or greater, you'll need to turn off tab-modal
> dialogs, as these aren't supported just yet. seehttps://github.com/vapir/vapir/wiki/Browser-Settings:
>
>    - (FF 4 and greater) Turn off tab-modal prompts. Go to about:config,
>    find prompts.tab_modal.enabled and set it to false.

Thanks for the prompt reply.

I am using 7.0.1. I just tried disabling tab-modal prompts for the
profile I use for testing, and it definitely has an effect (the dialog
is now an old-style dialog instead of the new tab-modal style), but
the test still fails with the same error.
Reply all
Reply to author
Forward
0 new messages