Post Thu Apr 23, 2009 7:20 am

Selenium Chrome mode + Openbravo Pop ups

Selenium can be launched on firefox using two modes: proxy and chrome.


The chrome mode allows selenium to simulate some privileged actions that are not possible with the other mode. For example (and one of the causes of this post), selenium 1.0-beta-2 supports file attachments only through chrome mode.


We define the browser that will be used to run the tests in the selenium.browser property of file. This value is then saved in com.openbravo.test.integration.OpenbravoERPTest.browser to be used by all the tests when launching selenium driver. The current version of selenium allows to use *firefox (currently this is chrome mode), *firefoxproxy, *iexplore, *iexploreproxy and *custom. However, on scenarios that require attachments it doesn't matter what browser you have configured, this value is going to be overwritten with *firefox.


Since the beggining we knew about this limitation. But the behaviour in selenium 1.0-beta-1 was different: what we call now as "*firefox" used to be "*chrome" and "*firefoxproxy" used to be "firefox". So, when we migrated to 1.0-beta-2 we found an interesting error on our code that hasn't appeared before. On the first execution with the new libraries we left the browser property as *firefox and got weird errors caused because Pop Ups never ended loading. Arun added this bug and we started looking for the cause until we realized that Openbravo Pop Ups can't be opened with selenium using chrome mode. This happens with the old libraries too, but we haven't realized that before. We are still looking for the reason of this weird behaviour, but as our smoke suite doesn't require to simulate actions on pop ups and attach files on the same test we can run it without problems.


The rule we are using now for firefox is simple:

- if the test requires to attach a file, use *firefox overwritting the browser variable (see the setUp function of A_01A_InitialOrganizationSetup for an example)

- the rest of the tests should use *firefoxproxy as the selenium.browser property.

Post Edited by elopio at 04/23/2009 06:23

Post Edited by elopio at 04/23/2009 06:26