Hi,
you're right the IE specific method showModalDialog is not currently
supported by htmlunit. A workaround could be to let the test run
simulating Firefox (if your application works for this browser too).
When the dom is changed (either by javascript inside the page or by some
script from "outside"), the content of the page is changed but not the
page itself and therefore you don't see a new "response" in WebTest's
report. A response corresponds to a server response and in this case
none occured.
To "see" the page state at the end of your <scriptStep> you can add
something like
<groovy>
println step.context.currentResponse.asXml()
</groovy>
Marc.
XiaoLu Wang wrote:
> hi all, here is my problem with webtest
>
> :
> 1. In the form javascript use "var rv =
> window.showModalDialog(thisUrl,"little_purchase_sto...." to open
> window.showModalDialog,
> then use "var rv" to create <input type=hidden .../> field
> dynamicly ,js code like this
> "..insertCell().innerHTML='<input name="merchandiseNO" type="hidden"
> value="'+rv[0]+'">';//8"
>
> 2. 1st I found that canoo does not support showModalDialog and i someone
> told me i should invoke the url in showModalDialog() directly,
> but failed (still can't fix it,anyony knows how to deal with
> ModalDialog other way?)
>
> 3. so i tried scriptSteps to insert HtmlElment to document ,but seems
> response won't change at all when outof scriptSteps tag,
> So, i wonder if i could insert the parameter directly to action-
> destination url of the form?
>
> CODE HERE:
> <scriptStep stepid="run script" language="javascript"> <![CDATA[
> //将订单号显示出来
> j_stock_inNo=document.getHtmlElementById('j_stock_inNo');
> j_stock_inNo_value=j_stock_inNo.getAttributeValue('value');
> step.setWebtestProperty('j_stock_inNo_value', j_stock_inNo_value);
> //goodsList Table
> goodsList=document.getHtmlElementById('goodsList');
> tr2=goodsList.getRow (0).cloneNode(true);
> goodsList.appendChild(tr2);
>
> //merchandiseNO
> td0=goodsList.getCellAt(0,0);
> td0.appendChildIfNoneExists('input');
> input0= td0.getOneHtmlElementByAttribute('input','type','text');
> input0.setAttributeValue('name','merchandiseNO');
> input0.setAttributeValue('type','hidden');
> input0.setAttributeValue('value','ME20061115000103');
>
> ]]>
> </scriptStep>
>
>
>
>
>
>
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest