A tip for testing JQuery Autocomplete with Selenium

Selenium is a great tool for testing web application. It tests the client side by launching a web browser and executing functional tests. Developing a test is very easy; we need just to record the test one time by Selenium IDE (Firefox plug-in). The recorded test can be exported to a JUnit test.
But sometimes testing screens with Ajax components need some caution to wait for asynchronous communication and for DHTML to be changed.
The source code below can help testing a JQuery Autocomplete field using Selenium.

                selenium.typeKeys("??locator??", "a");

                int second = 0;
                    if(second >= 10)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s