Testing jQuery Selectable example

This page is about Testing Automation of jQuery Selectable example. By lerning this example, you can understand how to select the element in the web browser by program using JUnit and selenium.

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

About test cases

This test case check the selected part, which is selected by mouse click and drag and drop.

select by drag and drop

The picture is selected by drag and drop by Junit and Selenium programming.

The evidense screen shot is stored at location below.

/[Project]/screenshots/selectable

screenshot of selectable

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  testingjQuery selectable  example

The "JQuerySelectableTest" 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 select the item by click

This test case do actions below.

  1. Go to the test page
  2. Click item and select it

Source code of this test case

The source code of this test case is below.

It just click the item and select it.

Testing to select the items by dragging

This test case do actions below.

  1. Go to the test page
  2. Drag items and select it

Source code of this test case

The source code of this test case is below.

Dragging the item by mouse and select the items.

screenshot on dragging

This screenshot is taken before release the mouse. The drag and drop action consists of clickAndHold(), moveToElement(), and release().

After release the mouse, the items are selected like below.

screenshot after items selected


Go to Top