Hi Vishal,

I have encountered similar issue before.
If the optoin value "243","244"... aren't dynamic, give this a try.
<setSelectField name="CountryId" value="243" description="select Brazil"/>

Hope that helps.
Lily




________________________________
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Vishal Pai
Sent: Thursday, July 17, 2008 5:27 AM
To: [email protected]
Subject: [Webtest] JavaScript dropdown+AJAX

Hi,
I am working with a country dropdown list in JS which triggers on selection a 
AJAX code to populate a field below it .

The piece of source looks like this.



<select name="CountryId" onchange="javascript:getAlignmentName()" 
style="50%"><option value="" selected="selected">&nbsp;

&nbsp;</option>

                                              <option 
value="243">Brazil</option>

<option value="244">Chile</option>

<option value="245">China</option>

<option value="268">India</option>

<option value="246">Egypt</option>

</select>

                       </td>

                               <td></td>

>From the WebTest recorder,I select the Country as Brazil but I get the script 
>as :

<setSelectField name="CountryId" text="Brazil"/>

which is  not good enough for WebTest to parse through.

So,as seen in the example in 
docs(http://webtest.canoo.com/webtest/manual/setSelectField.html),I tweaked it 
to

<setInputField description="Select a country: *" name="CountryId" 
value="Brazil"> </setInputField>

My test now read like this

<webtest name="Test1- SR2.0">
        <config>
        <option name="ThrowExceptionOnScriptError" value="false" />
        </config>
            <invoke url="http://10.12.91.213:7001/sr2/login.do"; 
description="Login "/>
            <verifyTitle text="Home"/>
            <setInputField description="Select a country: *" name="CountryId" 
value="Brazil"> </setInputField>
            <setInputField name="alignmentVO.operatorName" value="Delta"/>
            <clickButton label="Next"/>
            <verifyText description="Verify that text is contained in the page" 
text="Brazil "/>
            <verifyText description="Verify that text is contained in the page" 
text="Delta-Brazil"/>

</webtest>

Even this script doesn't get through successfully.
I am not sure what's going wrong in here.

Has anyone got around a similiar issue?

Regards,
Vishal




________________________________
Check news, cricket, entertainment and astrology right from your mobile. Browse 
http://m.msnindia.com from your GPRS mobile phone. Try it 
now!<http://m.msnindia.com>

Reply via email to