htmlunit-set-radio-button-success.xml from Jameleon at Krugle
Show htmlunit-set-radio-button-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-radio-button tag</test-case-summary>
<test-case-author>Christian Hargraves</test-case-author>
<test-case-level>ACCEPTANCE</test-case-level>
<functional-point-tested>htmlunit-set-radio-button</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 radio1 is currently unchecked"
xpath="//form[@name='testform1']/input[@name='radio1' and not(@checked)]"
msg="radio1 is already checked!"/>
<htmlunit-set-radio-button
functionId="Check radio1 with value rad1"
xpath="//form[@name='testform1']/input[@name='radio1' and @value='rad1']"
checked="true"/>
<htmlunit-validate
functionId="Validate that radio1 is checked"
xpath="//form[@name='testform1']/input[@name='radio1' and @value='rad1' and @checked]"
msg="radio1 with value rad1 was not checked!"/>
<htmlunit-set-radio-button
functionId="Uncheck radio1 with value rad1"
xpath="//form[@name='testform1']/input[@name='radio1' and @value='rad1']"
checked="false"/>
<htmlunit-validate
functionId="Validate that radio1 with value rad1 is not checked"
xpath="//form[@name='testform1']/input[@name='radio1' and @value='rad1' and not(@checked)]"
msg="radio1 with rad1 was checked!"/>
<htmlunit-set-radio-button
functionId="Check radio1 value rad2 by form, fieldName and checked attributes"
form="testform1"
fieldName="radio1"
value="rad2"
checked="true"/>
<htmlunit-validate
functionId="Validate that radio1 with value rad2 is checked"
xpath="//form[@name='testform1']/input[@name='radio1' and @value='rad2' and @checked]"
msg="radio1 with value rad2 was not checked!"/>
</htmlunit-session>
</testcase>
See more files for this project here