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>