[Webtest] Testing onclick handler of a button

Matt Raible webtest@lists.canoo.com
Sun, 05 Dec 2004 11:14:11 -0700


This is a multi-part message in MIME format.
--------------080609040300070303060609
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Chakra Yadavalli wrote:

>Matt, Could you please send the HTML rendered by your JSP page? I
>recently debugged similar issues.
>  
>

Please see attached.

Thanks,

Matt


>Thank you,
>Chakra.
>
>
>On Sat, 04 Dec 2004 14:11:22 -0700, Matt Raible <lists@raibledesigns.com> wrote:
>  
>
>>I'm using build 574 and I'm trying to verify that JavaScript support is
>>working, and it doesn't appear to be.
>>
>>I have the following in a JSP - with no <form> element wrapped around it
>>(since <button>s don't need them):
>>
>>    <button type="button" onclick="location.href='<html:rewrite
>>forward="mainMenu"/>'" id="cancel">
>>        <fmt:message key="button.cancel"/>
>>    </button>
>>
>>Then in my test, I have:
>>
>>    <target name="testJavaScript" description="Tests cancelling with
>>onclick">
>>        <canoo name="testJavaScript">
>>            &config;
>>            <steps>
>>                &login;
>>                <invoke stepid="view users list" url="/users.html"/>
>>                <verifytitle stepid="we should see the user list title"
>>                    text="${webapp.prefix}${userList.title}"/>
>>                <clickbutton label="${button.cancel}" htmlid="cancel"
>>stepid="Click button 'Cancel'"/>
>>                <verifytitle stepid="Display Main Menu"
>>text="${webapp.prefix}${mainMenu.title}"/>
>>            </steps>
>>        </canoo>
>>    </target>
>>
>>This results in:
>>
>>testJavaScript:
>>
>>BUILD FAILED
>>C:\Source\appfuse\build.xml:794: The following error occurred while
>>executing th
>>is line:
>>Test step clickbutton (C:\Source\appfuse\test\web\web-tests.xml:126: )
>>named "C
>>lick button 'Cancel'" failed with message "No button found"
>>
>>Total time: 8 seconds
>>
>>Any ideas how to solve this would be great.  Do I need the Rhino js.jar
>>in my classpath for the JavaScript support with HTMLUnit?  I tried
>>adding it, but it didn't change the results.
>>
>>Thanks,
>>
>>Matt
>>
>>_______________________________________________
>>WebTest mailing list
>>WebTest@lists.canoo.com
>>http://lists.canoo.com/mailman/listinfo/webtest
>>
>>    
>>
>
>
>  
>


--------------080609040300070303060609
Content-Type: text/html; charset=UTF-8;
 name="lastResponse1102270292251.html"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="lastResponse1102270292251.html"

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
        






















<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
        
                <!-- HTTP 1.1 -->
        <meta http-equiv="Cache-Control" content="no-store"/>
        <!-- HTTP 1.0 -->
        <meta http-equiv="Pragma" content="no-cache"/>
        <!-- Prevents caching at the Proxy Server -->
        <meta http-equiv="Expires" content="0"/>
        
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> 
        
        <meta name="author" content="Matt Raible (matt@raibledesigns.com)"/>
        <link rel="icon" href="/appfuse/images/favicon.ico"/>
        <title>AppFuse ~ User List</title>
        <script type="text/javascript" src="/appfuse/scripts/helptip.js"></script>
        <link rel="stylesheet" type="text/css" media="all" href="/appfuse/styles/default.css" /> 
        <link rel="stylesheet" type="text/css" media="all" href="/appfuse/styles/helptip.css" />
        <link rel="stylesheet" type="text/css" media="print" href="/appfuse/styles/print.css" />     
        <script type="text/javascript" src="/appfuse/scripts/global.js"></script> 
      
        <link rel="stylesheet" type="text/css" media="all" href="/appfuse/styles/menuExpandable.css" /> 
        <script type="text/javascript" src="/appfuse/scripts/menuExpandable.js"></script>
      
        
        <style type="text/css" media="all">
            div.standardsNote {background: #FFFFCC; border: 1px solid blue; margin-bottom: 10px; padding: 5px}
        </style>
    </head>
<body>

    <div class="standardsNote">
        <strong>Note:</strong> This site's content is accessible to all versions of every browser. However, this browser may not support basic Web standards, preventing the display of our site's design details. We support the mission of the Web Standards Project in the <a href="http://www.webstandards.org/upgrade/">campaign</a> encouraging users to upgrade their browsers.
    </div>

    <div id="screen">

        <div id="header">
            
            
                <div id="userStatus">
                    Logged in as: 
                    <strong>Matt 
                        Raible</strong><br />
                    <a href="/appfuse/logout.jsp">Logout</a>
                </div>
            
            
            
























<div id="activeUsers">
    
        <a href="/appfuse/activeUsers.html">Current Users</a>:
    
    
    10
</div>



    <a href="/appfuse/mainMenu.html">Main Menu</a>



        </div>

        
            




















<div id="menu">
<div id="menuDiv"><ul id="menuList">


    	<li class="menubar">

	<a href="#" id="AdministrationActuator" class="actuator">Administration</a>
		<ul id="AdministrationMenu" class="menu">

	<li><a href="/appfuse/editUser.html?method=Search" title="View Users">View Users</a></li>
	<li><a href="/appfuse/reload.html" title="Reload Options">Reload Options</a></li>
</ul>
	</li>


    	<li class="menubar">

	<a href="/appfuse/editProfile.html" title="Edit Profile" class="standalone">Edit Profile</a>
	</li>


    	<li class="menubar">

	<a href="/appfuse/selectFile.html" title="Upload A File" class="standalone">Upload A File</a>
	</li>


    	<li class="menubar">

	<a href="/appfuse/flush.html" title="Flush Cache" class="standalone">Flush Cache</a>
	</li>


    	<li class="menubar">

	<a href="/appfuse/clickstreams.jsp" title="Clickstream" class="standalone">Clickstream</a>
	</li>


</ul></div>
</div>
<script type="text/javascript">
    initializeMenus();
</script>
        

        <div id="content">
            <h1>Current Users</h1>
            




            <button type="button" style="margin-right: 5px"
        onclick="location.href='/appfuse/editUser.html?method=Add&from=list'">
        Add
    </button>
    
    <button type="button" onclick="location.href='/appfuse/mainMenu.html'" id="cancel">
        Cancel
    </button>

<span class="pagebanner">2 users found, displaying all users.</span>
<table cellpadding="0" class="list userList" cellspacing="0" id="users">
<thead>
<tr>
<th width="17%" class="order1 sortable sorted">
<a href="?d-149542-s=0&amp;d-149542-o=1">Username</a></th>
<th width="20%" class="sortable">
<a href="?d-149542-s=1&amp;d-149542-o=2">First Name</a></th>
<th width="13%" class="sortable">
<a href="?d-149542-s=2&amp;d-149542-o=2">Last Name</a></th>
<th width="26%" class="sortable">
<a href="?d-149542-s=3&amp;d-149542-o=2">E-Mail</a></th></tr></thead>
<tbody>
<tr class="odd">
<td width="17%">
<a href="/appfuse/editUser.html?username=mraible&amp;from=list">mraible</a></td>
<td width="20%">Matt</td>
<td width="13%">Raible</td>
<td width="26%"><a href="mailto:matt@raibledesigns.com">matt@raibledesigns.com</a></td></tr>
<tr class="even">
<td width="17%">
<a href="/appfuse/editUser.html?username=tomcat&amp;from=list">tomcat</a></td>
<td width="20%">Tomcat</td>
<td width="13%">User</td>
<td width="26%"><a href="mailto:matt_raible@yahoo.com">matt_raible@yahoo.com</a></td></tr></tbody></table><div class="exportlinks">Export options: 
<a href="?d-149542-e=1&amp;6578706f7274=1"><span class="export csv">CSV </span></a>| 
<a href="?d-149542-e=2&amp;6578706f7274=1"><span class="export excel">Excel </span></a>| 
<a href="?d-149542-e=3&amp;6578706f7274=1"><span class="export xml">XML </span></a>| 
<a href="?d-149542-e=5&amp;6578706f7274=1"><span class="export pdf">PDF </span></a></div>

<button type="button" style="margin-right: 5px"
        onclick="location.href='/appfuse/editUser.html?method=Add&from=list'">
        Add
    </button>
    
    <button type="button" onclick="location.href='/appfuse/mainMenu.html'" id="cancel">
        Cancel
    </button>
            
<script type="text/javascript">
<!--
highlightTableRows("users");
//-->
</script>
        </div>
        
        <div id="footer">
            




















<div id="validators">
    <a href="http://jigsaw.w3.org/css-validator/check/referer"><img 
        src="/appfuse/images/vcss.png" 
            alt="Valid CSS!" class="badge" /></a> 
    <a href="http://validator.w3.org/check/referer"><img
        src="/appfuse/images/valid-xhtml10.png"
            alt="Valid XHTML 1.0!" class="badge" /></a>
</div>

Version 1.7-dev
&middot; Copyright &copy; 2004 
&middot; <a href="http://www.raibledesigns.com">Your Company Here</a><br />
Style respectfully borrowed from Blue Robot's
<a href="http://www.bluerobot.com/web/layouts/">Layout Reservoir</a>

<!--
#Build Information
#Sun Dec 05 11:09:23 MST 2004
build.dao.type=hibernate
build.time=11\:09\:23 AM MST
build.computer=FATBASTARD
webapp.version=1.7-dev
build.date=Sunday Dec 05, 2004
build.username=mraible

-->
        </div>
        
    </div>

</body>
</html>

--------------080609040300070303060609--