Below is the html from a webpage I am trying to test. I know it is malformed, as I have already had to deal with that issue. My problem is that if I try to click the Submit button using this code <clickButton name="Submit" label="OK"/> I get an error. That is fine, I have assumed it has to do with the malformed html. The problem lies in that if I use this code <clickButton xpath="//[EMAIL PROTECTED]'submit']"/> Webtest reports a success. If I do a <selectWindow/> for a non existent window after this step; the report tells me I have two windows I can select from (the Postal Codes Window and the main window). So it looks like the xpath did not successfully click the button even though it reported that it did. Is this a correct assumption? If so, does it hold greater implications for my testing at large using xpath. I have been using xpath a lot in my testing and if malformed xml cause an incorrect report from xpath then debugging is going to be a pain and I fear false positives in my tests. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Select Postal Codes</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="/css/SNMstylesheet.css" rel="stylesheet" type="text/css"> <link href="/css/SNMPrintstylesheet.css" rel="stylesheet" type="text/css" media="print"> <link href="/js/calendar-win2k-cold-1.css" rel="stylesheet" type="text/css"> <script src="/js/util.js" type="text/javascript"></script> <script src="/js/sort.js" type="text/javascript"></script> <script src="/js/tooltip.js" type="text/javascript"></script> <script src="/js/calendar.js" type="text/javascript"></script> <script src="/js/calendar-en.js" type="text/javascript"></script> <script src="/js/calendar-setup.js" type="text/javascript"></script> <script src="/js/calendar-util.js" type="text/javascript"></script> <script src="/js/validations.js" type="text/javascript"></script> <script src="/js/hashtable.js" type="text/javascript"></script> <script src="/js/RoboHelp_CSH.js" type="text/javascript"></script> <!-- insert head --> <script type="text/javascript"> function searchPostalCodes() { var postalCodeSelectForm = document.forms["postalCodeSelectForm"]; postalCodeSelectForm.submit(); } function add() { var tableElement = document.getElementById('postalCodeTable'); var postalCodesArray = new Array(); for (var i = 1; i < tableElement.rows.length; i++) { if (document.getElementById('postalCodeSelect' + i).checked) { var postalCodeArray = new Array(document.getElementById('postalCode' + i).value, document.getElementById('postalCodeCity' + i).value, document.getElementById('postalCodeState' + i).value); postalCodesArray.push(postalCodeArray); } } window.opener.addPostalCodes(postalCodesArray); window.opener.focus(); window.close(); } </script> <!-- end insert head --> <script type="text/javascript"> function packHeight() { // note that adjusting the width is problematic because it can cause things to wrap that shouldn't var dialogFrame = document.getElementById("dialogFrame"); } function showSize() { alert("dialogFrame offsetWidth: " + dialogFrame.offsetWidth + " offsetHeight: " + dialogFrame.offsetHeight + "\n" + "dialogFrame scrollWidth: " + dialogFrame.scrollWidth + " scrollHeight: " + dialogFrame.scrollHeight + "\n" + "dialogFrame clientWidth: " + dialogFrame.clientWidth + " clientHeight: " + dialogFrame.clientHeight + "\n" + "dialogFrame width: " + dialogFrame.width + " height: " + dialogFrame.height); } </script> </head> <body class="dialogBody" onload="onloadPopup(1798000);packHeight();"> <div id="dialogFrame"> <div id="dialog_masthead"> <img class="logo" src="/images/masthead/ESObranding.gif" /> </div> <div id="contentDialogContent"> <h1>Select Postal Codes</h1> <form action="/data/postalCodeSelect.do" name="postalCodeSelectForm" id="postalCodeSelectForm" onsubmit="add(); return false;" method="POST"> <div class="dialogContent"> <table class="tuple"> <tr> <th>Display Postal Codes Within:</th> <td><select name="miles"><option value="5" selected="selected">5</option><option value="10">10</option><option value="15">15</option><option value="20">20</option><option value="25">25</option><option value="50">50</option><option value="75">75</option><option value="100">100</option></select> miles of the Postal Code <input name="postalCode" type="text" size="10" value="78703" > </td> </tr> <tr> <td> <input type="button" class="button" onclick="searchPostalCodes();" value="Search" > </td> </tr> </table> <div id="areaHeading" ><h2>Postal Codes</h2></div> <table id="postalCodeTable"class="data"> <tr> <th></th> <th>Postal Code</th> <th>City/Region</th> </tr> <tr> <td><input id="postalCodeSelect1" type="checkbox" value="checkbox" > </td> <td> 78746 <input id='postalCode1' type="hidden" value='78746' > </td> <td> Austin, TX <input id='postalCodeCity1' type="hidden" value='Austin' > <input id='postalCodeState1' type="hidden" value='TX' > </td> </tr> </table> </div> </div> <div class="dialogButtonBar"> <input type="submit" class="button" name="Submit" value="OK" onclick=""> <input type="button" class="button" name="Submit" value="Cancel" onclick="window.close();"> </div> </form> </div> </div> </body> </html>
William Soula QA Analyst Pointserve, Inc. 110 Wild Basin Road Suite 300 Austin, Texas 78746 O: 512.617.5311 F: 512.617.0466

