Bug 53899: Fix --assertpagefile functionality

A change from a few months ago (the refactoring of Test's constructor) caused
the assertpagefile functionality to stop working.  The code that extracts the
filename from the config hash used the key "assertpage" instead of
"assertpagefile".  It didn't help that the same file is referred to as both
"assertpage" and "assertpagefile" in method and variable names throughout the
source, with as many different capitalizations as can be imagined.

Testing done:

Ran the test case from the bug.  It passed (or rather failed) as expected.
Bug 44048: Create <option> event

This change implements part of the requested functionality in bug 44048: the
option event.  A standard set of attributes was given to this event.

A strange wrinkle with the selectors API was found: for some reason, it seems
impossible to find an option event using its value attribute like so:

  option[value="foo"]

even when the corresponding HTML is:

  <select><option>foo</option></select>

The HTML 4.0.1 spec is clear that "foo" should be the value of the value
attribute, and inspecting the DOM shows that it is.  Strangely, though, using
a CSS selector for that doesn't work.

To cope with that, the iterative code used to find elements by value developed
for IE is used when no html_type attribute has been defined for an event.  So
far, that only means the option event.  That code works well and finds option
tags.

Testing done:

Ran a test script to exercise the new event's attributes.
Fix VDDReporter path stupidity.

In several places, VDDReporter blithely assumes the '/' character is used
to separate path components.  This is fine on Linux (and MacOS), but
rapidly breaks down on Windows.  Using only '/' is OK there, and using the
native separator '\' is also OK, but mixing the two is generally not.
This change fixes all of the instances of such breakage I could find.  It
also scratches the surface of cleaning up this program.  A more thorough
job could take quite some time and so many glaring sections in need are
left for the future.

Testing done:

Ran against an output directory of VDD.  Checked that all options still
work (even if --help prints nothing of use).
VDD test suite fixes.

This change makes the textfield VDD unit test work with IE.  A "feature"
of IE is that it will not accept invalid file paths in its file input
fields.  This test used a deliberately invalid path and so didn't work.
This has been fixed (assuming that autoexec.bat is always present).  Also,
the CSV library in use drops unescaped \ characters, causing more windows
path problems, and so the path in the test csv file has had its
backslashes escaped.

Testing done:

Ran the textfield VDD unit test.
Fix jscriptevent for IE.

The jscriptevent code assumed the existence of the javascript method
document.createEvent.  That method exists for Firefox and Chrome, but no
IE.  IE instead uses the somewhat different document.createEventObject.
This change updates the generated javascript code for jscriptevent to use
whichever method is present.

Testing done:

VDD unit test.
Fix file/path handling in suite files

This change fixes the largest area of path separator difficulties within
VDD: suite files.  Rather than passing strings around and manually
fiddling with '/' and '\' conversion, (almost) all files and paths are
converted to File objects and manipulation is done with those instead,
letting the Java lib handle all the details.  A goodly amount of cleanup
was done to SuiteParser as well.

The most major change, though, is the addition of a new gvar:
global.basedir.  Prior to this change, relative paths in suite files are
taken to be relative to whatever directory VDD started running in, rather
than the directory the suite file is in, which makes more intuitive sense.
To avoid mass breakage, this behavior is still the default.  However, if
the gvar "global.basedir" is set, it is used as the base directory for
relative paths in suite files.

Testing done:

Ran sugarinit.xml with and without global.basedir and with paths specified
with different combinations of '/' and '\' directory separators.
Work around a java.io.File "feature".

When creating a File object with both parent and child paths, the javadocs
state that, if the child is absolute, it will be resolved in a
system-dependent manner.  What this turns out to mean is that it will be
simply appended onto the end of parent.  Obviously, if the child path is
absolute, that won't work as expected.  This change works around that
problem by checking whether the child path is absolute and only appending
it to the parent path if it isn't.

Testing done:

Ran the problem case.
Plumb --haltOnFailure into Reporter

The one place in the code that is always run when an error occurs is
within the Reporter object.  So, to make --haltOnFailure actually halt on
failure, this change plumbs the option down into Reporter's routines for
error reporting.

Testing done:

Ran a test script with errors.  VDD terminated as expected.
Fix Z-order bug with input.clear()

This change works around Selenium issue 3402.  On IE, when a text field, a
password field, or a textarea gets cleared using WebElement.clear(), the
IE window is sent to the back of the Z-order.  This only happens the first
time clear() is called for any element.  Rather than wait for a bug fix,
this change uses a Javascript snippet on IE to clear the control.

Testing done:

Ran clear() on a text, password, and textarea element.  The window stayed
in the foreground.
Bug 54613: text should search all innerText

The text attribute had mapped directly to Selenium's By.linkText.  Since text
is allowed for many events besides link, this behavior is confusing and not
particularly useful.  This change expands searching by text so that all
HTML events can use it.  For link events, By.linkText is still used.  For all
others, the value is searched for within elements' innerText.

Testing done:

Ran the test script from the bug.
Bug 54159: Add required attribute to td

The td event was missing the required attribute.  This change adds it.

Testing done:

Ran a script with <td required="true"/>
Replace link text

A recent change to expand finding by text to non-a elements left out a call
to replaceString.  This change adds that call.

Testing done:

Find by text with a required string substitution.
Bug 55085: Switch back to default frame

When switching to a subframe, VDD would only switch back to the default frame
if that frame event had no children, clearly a bug.  This change switches
back to the default frame at the conclusion of the frame event unconditionally.

Testing done:

Ran script from bug.
Update selenium libs to 2.25.0

This change updates the selenium libs to the latest version, 2.25.0.  The bug
that had been blocking the upgrade, 3393, has been fixed for Firefox.  Fixes
for IE and Chrome are presumed to be forthcoming.  With this change, Firefox
up to 14 is confirmed to work.  A follow-on change implementing the new alert
functionality will be made.

Testing done:

VDD test suite.  Further testing will be done after the alert handling code
has been added in the next change.
Add unexpectedAlertBehavior capability to Firefox

This change folds in the new alert functionality from Selenium, returning
Selenium's functionality with respect to alerts to its pre-2.18 mode of
operation.  With this change, alerts will not be dismissed and an
UnexpectedAlertException will not be thrown when one is seen.  Rather, as
was the prior behavior, VDD scripts will continue to explicitly handle them.

Testing done:

Admin Soda suite.  All alerts were handled as expected (no hangs).  The few
errors were unrelated to this change and are similar to those seen when
running VDD master.
Bug 55464: Add several missing events.

This change adds support for the H1..H6, I, B, STRIKE, S, and U events to VDD.

Testing done:

Ran the script from the bug.
Bug 55678: Add TH event

This change adds the TH event to VDD.

Testing done:

Ran a script with a TH event.
Bug 55735: Add jscriptevent to image event

This change adds the code for jscriptevent to the image event.

Testing done:

Ran a test that uses jscript=onmouseover in an image event.
Bug 55786: Stop reloading select element

This change reworks the select event so that the actions that can cause page
loads are executed last.  This obviates the need to reload the element and
fixes both this bug and the original bug, 49533, that resulted in the reload.

As part of fixing this bug, the select event was rewritten significantly.
This will hopefully make the code more logical and easier to maintain.  In
addition, the unit test for the select event was rewritten to cover all
(positive) cases.

Testing done:

Ran the VDD select unit test.  VDD has no way to perform negative tests, so
that testing was done with temporary modifications to the unit test.
Bug 56570: Replace text in 'exists' attribute.

This change makes variable replacement in the exists attribute.  During
execution of the link event, the text in this attribute is replaced in the
event itself and various log messages are made with this.  However, the code
in findElement takes the unreplaced text out of the event and uses that
instead, then, confusingly, prints out hardcoded text for the values so it
looks as though replacement is being done incorrectly.

Fortunately the fix for this mess is a one-liner.

Testing done:

Ran the test script from the bug.