This document contains a simple preliminary descritption of testcases on CurrentPage interface of Webclient API.

- Tests on copyCurrentSelectionToSystemClipboard() method
- Tests on findInPage(String, boolean, boolean) method
- Tests on findNextInPage(boolean) method
- Tests on getCurrentURL() method
- Tests on getSource() method
- Tests on getSourceBytes() method
- Tests on resetFind() method
- Tests on selectAll() method
- Tests on getDOM() method
- Tests on getPageInfo() method

## 1. Tests on copyCurrentSelectionToSystemClipboard() method.

Test ID | Action | Expected Result
basic/api/CurrentPage_copyCurSel:0 | Method is invoked without any URL string | Browser doesn't crashed
basic/api/CurrentPage_copyCurSel:1 | Method is invoked with no selection | Clipboard content doesn't change
basic/api/CurrentPage_copyCurSel:2 | Method is invoked with selected text | Clipboard gets selected text

## 2. Tests on findInPage(String search_string, boolean forward, boolean matchcase) method.

Test ID | Action | Expected Result
basic/api/CurrentPage_findInPage_1:0 | Method is invoked with null search string | Browser doesn't crashed
basic/api/CurrentPage_findInPage_1:1 | Method is invoked with empty search string | Browser doesn't crashed
basic/api/CurrentPage_findInPage_1:2 | Method is invoked with exist search string | Browser finds search string
basic/api/CurrentPage_findInPage_1:3 | Method is invoked without any URL | Browser doesn't crashed
basic/api/CurrentPage_findInPage_1:4 | Method is invoked with unexist search string | Browser doesn't crashed and finds nothing
basic/mixed/CurrentPage_findInPage_2:0 | Method is invoked with forward=true and matchcase=true | Browser finds search string
basic/mixed/CurrentPage_findInPage_2:1 | Method is invoked with forward=true and matchcase=false | Browser finds search string
basic/mixed/CurrentPage_findInPage_2:2 | Method is invoked with forward=false and matchcase=true | Browser finds search string
basic/mixed/CurrentPage_findInPage_2:3 | Method is invoked with forward=false and matchcase=false | Browser finds search string

## 3. Tests on findNextInPage(boolean forward) method.

Test ID | Action | Expected Result
basic/mixed/CurrentPage_findNextInPage:0 | Method is invoked with forward=true | Browser finds search string
basic/mixed/CurrentPage_findNextInPage:1 | Method is invoked with forward=false | Browser finds search string
basic/mixed/CurrentPage_findNextInPage:2 | Method is invoked without previous find | Browser finds nothing and doesn't crash
basic/mixed/CurrentPage_findNextInPage:3 | Method is invoked at the end of document | Browser finds nothing and doesn't crash

## 4. Tests on getCurrentURL() method.

Test ID | Action | Expected Result
basic/api/CurrentPage_getCurrentURL:0 | Method is invoked after URL is loaded | Method returns current URL
basic/api/CurrentPage_getCurrentURL:1 | Method is invoked during URL is loading | Method returns current URL
basic/api/CurrentPage_getCurrentURL:2 | Method is invoked without any URL | Browser doesn't crashed

## 5. Tests on getSource() method.

Test ID | Action | Expected Result
basic/api/CurrentPage_getSource:0 | Method is invoked without any URL | Browser doesn't crashed
basic/api/CurrentPage_getSource:1 | Method is invoked with correct URL | Method returns URL source

## 6. Tests on getSourceBytes() method.

Test ID | Action | Expected Result
basic/api/CurrentPage_getSourceBytes:0 | Method is invoked without any URL | Browser doesn't crashed
basic/api/CurrentPage_getSourceBytes:1 | Method is invoked with correct URL | Method returns URL source bytes

## 7. Tests on resetFind() method.

Test ID | Action | Expected Result
basic/api/CurrentPage_resetFind:0 | Method is invoked without any URL | Browser doesn't crashed
basic/api/CurrentPage_resetFind:1 | Method is invoked with previous search result | Find parameters is nulled
basic/api/CurrentPage_resetFind:2 | Method is invoked without previous search result | Browser doesn't crashed and find parameters is nulled

## 8. Tests on selectAll() method.

Test ID | Action | Expected Result
basic/api/CurrentPage_selectAll:0 | Method is invoked without any URL | Browser doesn't crashed
basic/api/CurrentPage_selectAll:1 | Method is invoked with correct URL | All is selected

## 9. Tests on getDOM() method.

Test ID | Action | Expected Result
basic/api/CurrentPage_getDOM:0 | Method is invoked without any URL | Browser doesn't crashed
basic/api/CurrentPage_getDOM:1 | Method is invoked with correct URL | Correct org.w3c.dom.Document object is returned

## 9. Tests on getPageInfo() method.

Test ID | Action | Expected Result
basic/api/CurrentPage_getPageInfo:0 | Method is invoked without any URL | Browser doesn't crashed
basic/api/CurrentPage_getPageInfo:1 | Method is invoked with correct URL | Correct java.util.Properties object is returned