Testing jQuery Sortable and Dialog example

This page is about Testing Automation of jQuery Sortable & Dialog example. This testing automation is example to sort list element by mouse action. Mainly it uses drag and drop.

In order to understand what test, please take a look at jQuery Sortable & Dialog before reading this page.

About test cases

This test case is testing about jQuery Sortable.

jquery sortable with connectwith function

The items are sortable with drag and drop, and by clicking the item, the dialog appears. This test example check the consequences of actions.

The evidense screen shot is stored at location below.

/[Project]/screenshots/sortable

screenshots of  sortable and dialog testing

Those screenshots a taken by Selenium program using taking screenshot technique.

Location of the source code

The source code to test this is in "org.alinous.test.html5.jqparts" package.

Source code folder of jQuery sortable example

The "JQuerySortableTest" class has the testing code of the JUnit.

Initialize WebDriver of the Selenium

At the first of the JUnit Test class, we initialize and connect the WebDriver, and make the download folder empty.

Testing to sort the items

In this testcase, the actions below is done.

  • Go to the test page
  • Sort the items by drag and drop

source code of the test case

The source code of this test case is below.

In this code, do drag and drop in the "dragAndDrop()" function. The source code is below.

This function has parameter to specify the source identifier and destination' one. It takes a screenshot while moving the item before drop it.


Go to Top