htmlunit-set-checkbox-success.xml from Jameleon at Krugle
Show htmlunit-set-checkbox-success.xml syntax highlighted
<?xml version="1.0" ?>
<!--
Jameleon HtmlUnit plug-in - A plug-in that uses HtmlUnit to drive web sites
Copyright (C) 2006 Christian W. Hargraves (engrean@hotmail.com)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111AssertLevel.NO_FUNCTION07 USA
-->
<testcase xmlns="jelly:jameleon" name="set text field success">
<test-case-summary>Tests the htmlunit-set-checkbox tag</test-case-summary>
<test-case-author>Christian Hargraves</test-case-author>
<test-case-level>ACCEPTANCE</test-case-level>
<functional-point-tested>htmlunit-set-checkbox</functional-point-tested>
<application-tested>htmlunit-plugin</application-tested>
<htmlunit-session baseUrl="file:./tst/html/forms.html" beginSession="true">
<htmlunit-validate
functionId="Validate that forms page was successfully loaded"
title="forms page"/>
<htmlunit-validate
functionId="Validate that checkbox1 is currently unchecked"
xpath="//form[@name='testform1']/input[@name='checkbox1' and not(@checked)]"
msg="The checkbox is already checked!"/>
<htmlunit-set-checkbox
functionId="Check checkbox1"
xpath="//form[@name='testform1']/input[@name='checkbox1']"
checked="true"/>
<htmlunit-validate
functionId="Validate that checkbox1 is checked"
xpath="//form[@name='testform1']/input[@name='checkbox1' and @value='cb_val1' and @checked]"
msg="The checkbox was not checked!"/>
<htmlunit-validate
functionId="Validate that the checkbox2 is currently checked"
xpath="//form[@name='testform1']/input[@name='checkbox2' and @checked]"
msg="The checkbox is not checked!"/>
<htmlunit-set-checkbox
functionId="Uncheck checkbox2"
xpath="//form[@name='testform1']/input[@name='checkbox2']"
checked="false"/>
<htmlunit-validate
functionId="Validate that checkbox2 is not checked"
xpath="//form[@name='testform1']/input[@name='checkbox2' and @value='cb_val2' and not(@checked)]"
msg="The checkbox was checked!"/>
<htmlunit-set-checkbox
functionId="Check checkbox2 by form, fieldName and checked attributes"
form="testform1"
fieldName="checkbox2"
checked="true"/>
<htmlunit-validate
functionId="Validate that checkbox2 is checked"
xpath="//form[@name='testform1']/input[@name='checkbox2' and @value='cb_val2' and @checked]"
msg="The checkbox was checked!"/>
<htmlunit-set-checkbox
functionId="Uncheck checkbox2 to get ready for a set checkbox by value"
xpath="//form[@name='testform1']/input[@name='checkbox2']"
checked="false"/>
<htmlunit-validate
functionId="Validate that checkbox2 is not checked"
xpath="//form[@name='testform1']/input[@name='checkbox2' and @value='cb_val2' and not(@checked)]"
msg="The checkbox was checked!"/>
<htmlunit-set-checkbox
functionId="Check checkbox2 by form, fieldName, value and checked attributes"
form="testform1"
fieldName="checkbox2"
value="cb_val3"
checked="true"/>
<htmlunit-validate
functionId="Validate that checkbox2 is checked"
xpath="//form[@name='testform1']/input[@name='checkbox2' and @value='cb_val3' and @checked]"
msg="The checkbox was checked!"/>
</htmlunit-session>
</testcase>
See more files for this project here