Testing with Selenium RC in NetBeans environment (FF3, IE8, Opera9)

Rate this item
(0 votes)

I am using frequently Selenium web application testing during development of different components and modules for CMS Joomla and Drupal. The best way is to perform testing directly from development IDE and here is excelent possibility to use Selenium module (plugin) inside of NetBeans. Latest versions of NetBeans (6.9, 6.9.1, 6.10.M1) have embedded Selenium Server ver.1.0.1, which can be started along with NB start.

Here are some notes from latest web application testing with NetBeans 6.10.M1 (PHP 5.3.3) :

1. Object of testing was Joomla component – web pages with custom validation functions (using Mootools 1.11)

2. Opera was not starting – necessary hack was to use on the beginning of test code command ‘selenium.open(url)’ twice as was written by amadouwade in http://code.google.com/p/selenium/issues/detail?id=411 (“You can use selenium.openWindow(url, windowdId) instead of selenium.open(url). Otherwise if you use selenium.open(url) twice the page will be loaded correctly.”).

3. Running the same test script with Internet Explorer 8 was most difficult story because of two major obstacles :

test run was very slow – four times slower as it was in the case using Firefox 3.6 (IE8 84s. / FF3 20s.)

test was alerting with non-existent error when after ‘selenium.type(..)’ command have to run page javascript on event ‘change’.

Slow testing progress of IE8 was caused by using default multiple Window browser arragement. Necessary correction can be solved by using -singleWindow Selenium RC start parameter, but Selenium server embedded in NB does not have possibility to set any startup parameters. Succesfull solution was to stop embedded Selenium server in NB and to start external Selenium server with following command :

call java -jar selenium-server.jar -singleWindow

In this environment test runs with IE8 speeded up to FF level reaching 27s. total time.

Second problem with IE8 not firing onchange event under Selenium RC control (manual testing was all OK) was finally solved with additional command (relating to Mootools 1.11 framework) located after ‘selenium.type’ command :

selenium.runScript(“element.fireEvent(‘change’,params)”);

in specific test context it was exactly written as selenium.runScript(“$$(‘input[name^=ex_com_content]‘).fireEvent(‘change’,’0′)”);

Solution was taken from http://cfc.kizzx2.com/index.php/tag/selenium-rc/ where are two possibilities shown :

jQuery selenium.runScript(“$(‘#MyInputElement’).trigger(‘change’)”);

JavaScript document.getElementById(‘MyInputElement’).onchange();

Read 2057 times Last modified onWednesday, 13 June 2012 10:15

Only registred users have rights to post comments. Please log-in or create an account.

We have 109 guests and no members online
Copyright © 2015 JotComponents
We have 109 guests and no members online
Copyright © 2017 JotComponents