Hi Marc,
I now have a similar situation where setting an input field results in a new
page. In Webtest R_1757, there is no problem. As you suggested, I use now
FF3 as browser. After setting the input field, there is a new 'Resulting
page'. Here is the log:
...
[setInputField]  INFO (com.canoo.webtest.steps.Step) - >>>> Start Step:
setInputField "TransportOrderDetail.rejectionExplanation=" (269/341)
[setInputField]  INFO (com.canoo.webtest.engine.WebClientContext) - Current
form set to (action=execute)
[setInputField]  INFO (com.canoo.webtest.steps.form.AbstractSetFieldStep) -
Found 1 suitable fields, considering only the first one
[setSelectField]  INFO (com.canoo.webtest.steps.Step) - >>>> Start Step:
setSelectField "TransportOrderDetail.rejectionReason=" (270/341)
[setSelectField]  INFO (com.canoo.webtest.steps.form.AbstractSetFieldStep) -
Found 1 suitable fields, considering only the first one
...

Performing this test in Webtest R_1799, executing the same testscript
becomes a problem, as the next field (a select field, name="rejectReason")
cannot be found anymore (No suitable form found having field named
"rejectReason"). Moreover, the 'Resulting page' after setting the input
field, looks different (most of the forms moved to the right). Here is the
log:
...
[setInputField]  INFO (com.canoo.webtest.steps.Step) - >>>> Start Step:
setInputField "TransportOrderDetail.rejectionExplanation=" (269/341)
[setInputField]  INFO (com.canoo.webtest.engine.WebClientContext) - Current
form set to (action=execute)
[setInputField]  INFO (com.canoo.webtest.steps.form.AbstractSetFieldStep) -
Found 1 suitable fields, considering only the first one
[setSelectField]  INFO (com.canoo.webtest.steps.Step) - >>>> Start Step:
setSelectField "TransportOrderDetail.rejectionReason=" (270/341)
 INFO (com.canoo.webtest.engine.WebClientContext) - Responses restored
 INFO (com.canoo.webtest.ant.WebtestTask) - Finished executing webtest
"BT01-09" (c:\testScripts\BT01-09.xml:15: )
 INFO (com.canoo.webtest.reporting.XmlReporter) - Writing report to
c:\testScripts\results\001_BT0109\WebTestReport.xml
 INFO (com.canoo.webtest.ant.WebtestTask) - Test report successfully
created.
      [ant] Exiting c:\testScripts\BT01-09.xml.
  [antcall] Exiting c:\testScripts\build_custom.xml.
...

Now, when I change the testscript, addressing the select field with an xpath
expression (//sele...@name='rejectReason']), then it does find the field!
Here is the log:
...
[setInputField]  INFO (com.canoo.webtest.steps.Step) - >>>> Start Step:
setInputField "TransportOrderDetail.rejectionExplanation=" (269/341)
[setInputField]  INFO (com.canoo.webtest.engine.WebClientContext) - Current
form set to (action=execute)
[setInputField]  INFO (com.canoo.webtest.steps.form.AbstractSetFieldStep) -
Found 1 suitable fields, considering only the first one
[setSelectField]  INFO (com.canoo.webtest.steps.Step) - >>>> Start Step:
setSelectField "TransportOrderDetail.rejectionReason=" (270/341)
[verifyTitle]  INFO (com.canoo.webtest.steps.Step) - >>>> Start Step:
verifyTitle (271/341)
...

So it seems that there is something wrong in the identification of the
fields. The next statement to fail is a click on a button with name
"RejectFromBto". When I replace the name tag with an xpath expression
(//inp...@name='RejectFromBto']), it does find the button, etc.
The problem only happens on the specific page.

Thanks!
David

-----Original Message-----
From: [email protected] [mailto:[email protected]]
On Behalf Of Marc Guillemot
Sent: dinsdag 10 november 2009 15:29
To: [email protected]
Subject: Re: [Webtest] Page action while setting an input field

Hi,

what kind of problem do you have with this test?

If I correctly remember, <script for="..."..> is specific to IE. Have 
you tried to simulate Firefox?

Cheers,
Marc.

David Jehoul a écrit :
> Hi,
> 
> I have a situation where a page action is executed whilst just setting 
> an input field.
> 
> This is (part of) the script:
> 
> …
> 
> <setInputField
> 
>       description="GoodsReceiptSearch.toNo_transportOrderLineNr="
> 
>       name="transportOrderLineNr"
> 
>       value="01"
> 
> />
> 
> <verifyTitle
> 
>       regex="true"
> 
>       text=".*Goods Receipt Search"
> 
> />
> 
> …
> 
>  
> 
> The log file shows the following:
> 
>  
> 
> …
> 
> [setInputField]  INFO (com.canoo.webtest.steps.Step) - >>>> Start Step: 
> setInputField "GoodsReceiptSearch.toNo_transportOrderLineNr=" (489/670)
> 
> [setInputField]  INFO 
> (com.canoo.webtest.steps.form.AbstractSetFieldStep) - Found 1 suitable 
> fields, considering only the first one
> 
> [setInputField]  WARN (com.gargoylesoftware.htmlunit.html.HtmlScript) - 
> <script for='document' ...>: no element found with id "document".
Ignoring.
> 
> [setInputField]  INFO (com.canoo.webtest.engine.WebClientContext) - 
> Content of window changed to http://172.21.0.132:9080/receipt_detail.jsp 
> (text/html)
> 
> [setInputField]  INFO (com.canoo.webtest.engine.WebClientContext) - 
> Content of current window changed, it will become current response
> 
> [setInputField]  INFO (com.canoo.webtest.engine.WebClientContext) - 
> Current form set to none
> 
> [setInputField]  INFO (com.canoo.webtest.engine.WebClientContext) - 
> Current response now: http://172.21.0.132:9080/receipt_detail.jsp
> 
> [verifyTitle]  INFO (com.canoo.webtest.steps.Step) - >>>> Start Step: 
> verifyTitle (490/670)
> 
> …
> 
> I don’t know exactly how to read this, but I don’t understand the 3^rd 
> line. Might this be the reason why the content of the window changes? 
> Any idea what I can do about it?
> 
>  
> 
> Many thanks!
> 
> David
> 

_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest

_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest

Reply via email to