Here is the javascript for updateSignatureFields. You can also see this page
by going to https://secure.primek.com/tour/index.jsp, clicking the "employee
login tour", clicking "transactions", clicking "loans", clicking "request a
new loan" til you get to the page with a list of documents with checkboxes.
(can't get to the page directly, I'm afraid).
This works with the older WebTest, not with the newer one, same HTML.
<script language="javascript" type="text/javascript">
function updateSignatureFields() {
var conditions = document.getElementsByName('condition');
var allConditionsChecked = true;
for (i = 0; i < conditions.length; i++) {
if (!conditions[i].checked) {
allConditionsChecked = false;
continue;
}
}
document.getElementById('legalName').disabled = !allConditionsChecked;
document.getElementById('username').disabled = !allConditionsChecked;
document.getElementById('password').disabled = !allConditionsChecked;
if (!allConditionsChecked) {
document.getElementById('legalName').value = '';
document.getElementById('username').value = '';
document.getElementById('password').value = '';
}
}
</script>
On Thu, Sep 9, 2010 at 1:53 PM, Lisa Crispin <[email protected]> wrote:
> Clearly we can't move to a newer version of webtest, but perhaps there is
> just some step I missed in installing the new version... here's the third
> problem I'm seeing.
>
> In a page we have a list of links to documentss that popup in a window. Of
> these two links below, clickLink brings up the first one fine, but on the
> second one, it does not bring up the window. There are no errors from
> webtest, but of course the test fails. The first link (the one that works)
> brings up a Windward doc. The second one is only trying to bring up a popup
> window.
>
> <tr>
> <td width="5%" valign="top" align="right">
> <input type="checkbox" value="condition2"
> name="condition" id="condition2"
>
> onchange="updateSignatureFields();""/>
> </td>
> <td width="60%" valign="top">
> <a id="Loan
> Policy_0" href="#"
> onclick="javascript: popupPage('Loan
> Policy', '/document?docId=lp&planId=1328&docNum=40');">Loan Policy </a>
> </td>
> </tr>
>
> <tr>
> <td width="5%" valign="top" align="right">
> <input type="checkbox" value="condition3"
> name="condition" id="condition3"
>
> onchange="updateSignatureFields();""/>
> </td>
> <td width="60%" valign="top">
> <a id="Loan
> Terms & Conditions_0" href="#"
> onclick="javascript:
> popupSizedWindow('/ee/loan/terms.pg', 'Loan Terms & Conditions', 475,
> 300);">Loan Terms & Conditions </a>
> </td>
> </tr>
>
> The webtest script for the first link is:
> <clickLink description="click Loan Policy doc link"
> label="Loan Policy"/>
>
> The one for the 2nd link is:
> <clickLink description="click the Loan Terms and Conditions link"
> label="Loan Terms & Conditions" />
>
> Thanks,
> Lisa
>
>
> --
> Lisa Crispin
> Co-author with Janet Gregory, _Agile Testing: A Practical Guide for Testers
> and Agile Teams_ (Addison-Wesley 2009)
> Contributor to _Beautiful Testing_ (O'Reilly 2009)
> http://lisacrispin.com
> @lisacrispin on Twitter
>
>
--
Lisa Crispin
Co-author with Janet Gregory, _Agile Testing: A Practical Guide for Testers
and Agile Teams_ (Addison-Wesley 2009)
Contributor to _Beautiful Testing_ (O'Reilly 2009)
http://lisacrispin.com
@lisacrispin on Twitter