[Webtest] AJAX Support

Michael Habbert Michael Habbert <Michael.Habbert@netpioneer.de>
Wed, 04 Apr 2007 14:44:50 +0200


Hi uhmm,

as far as I can see it the error occurs in sht setSelectField step as you can see:

 > Step: setSelectField "Select offering type" (13/15)

and at the bottom you can see:

Message was: No
option found
matching criteria in select HtmlSelect[<select
name="fOfferingSubtype"
id="fOfferingSubtype" class="body-text-small "
onchange="showRelevantCountries();">]

for further help it would be helpfull if you post your html-code.

Michael

uhmm@1234.sk wrote:
> Hey there,
> I've been looking around internet for ajax support in
> webtest, but
> haven't found anything what would help me. Hope people here
> can...
> 
> I have school example of ajax usage. 2 dropdowns, first one
> is
> changed, second one is updated. How shall I create test
> steps?
> 
> Easy it may seem, but it's not. Here is my try:
> 
> <setSelectField
>        description="Select offering type"
>        htmlid="fOfferingType"
>        text="Application Support"
> />
> <sleep description="12s pause" seconds="12" />
> <setSelectField
>        description="Select offering subtype"
>        htmlid="fOfferingSubtype"
>        value="Other"
> />
> 
> Errors I'm getting:
> [setSelectField]  INFO (com.canoo.webtest.steps.Step) - >>>>
> Start
> Step: setSelectField "Select offering type" (13/15)
>    [sleep] java.lang.NullPointerException
>    [sleep]     at
> com.gargoylesoftware.htmlunit.javascript.OptionsArray.get(OptionsArray.java:102)
>    [sleep]     at
> org.mozilla.javascript.ScriptableObject.getProperty(ScriptableObject.java:1343)
>    [sleep]     at
> org.mozilla.javascript.ScriptRuntime.getObjectElem(ScriptRuntime.java:1304)
>    [sleep]     at
> org.mozilla.javascript.ScriptRuntime.getObjectElem(ScriptRuntime.java:1288)
[...]
HtmlSelect[<select
name="fOfferingSubtype" id="fOfferingSubtype"
class="body-text-small "
onchange="showRelevantCountries();">]
  INFO (com.canoo.webtest.steps.Step) - Running with: Canoo
Webtest: R_1537.
  INFO (com.canoo.webtest.steps.Step) - Exception thrown from
this
class: com.canoo.webtest.engine.StepFailedException
  INFO (com.canoo.webtest.steps.Step) - Message was: No
option found
matching criteria in select HtmlSelect[<select
name="fOfferingSubtype"
id="fOfferingSubtype" class="body-text-small "
onchange="showRelevantCountries();">]
[...]


-- 
Mit freundlichen Grüßen
------------------------------------------------------------------------
Michael Habbert