3 messages in com.canoo.lists.webtestRe: [Webtest] Problem with autorefresh| From | Sent On | Attachments |
|---|---|---|
| vikr...@mastek.com | 18 Feb 2005 03:06 | |
| Dierk Koenig | 18 Feb 2005 03:19 | |
| Paul King | 18 Feb 2005 13:57 |
| Subject: | Re: [Webtest] Problem with autorefresh![]() |
|---|---|
| From: | Paul King (pau...@asert.com.au) |
| Date: | 02/18/2005 01:57:37 PM |
| List: | com.canoo.lists.webtest |
Hi Vikram,
The autorefresh functionality is a bit tricky. With autorefresh="false" the invoke will return the original page - the one containing the meta http-equiv. With autorefresh="true" the invoke will return the refreshed page immediately (without waiting for the 5 seconds you have specified). I.e. meta http-equiv does work but works immediately.
A typical scenario would be that the refresh goes to a different page. What you would normally do is have one test with autorefresh="false" and check for say title and some relevant page content of your page which says "click here if you are not redirected" (typical scenario). You could also check for the link on the page if you have one (normal case). Then you would have another test with autorefresh="true" and you would check the title and some relevant page content of the new page.
There is no need to have sleep anywhere - all webtest steps currently return immediately. That's why there are steps such as prepareDialogResponse to cater for immediate returns even with JavaScript being invoked. There has been on-going discussion about supporting multiple threads to support "more natural" browser behaviour but we haven't started implementing any of that yet.
Paul.
vikr...@mastek.com wrote:
Hi Friends,
I have problem with AutoRefresh feature in webtest.
I have a sample page in my application which has a Meta tag with refresh after 5 seconds. There is an input box on the page which has a predefined value as 'Previous Value'. I want to check if the value after the Page Refresh is changed or not and is the predefined one.
So I have written following TestSpec for it
<testSpec name="webtest test number 1"> <config host="172.16.199.29" port="8080" protocol="http" basepath="/test" summary="true" saveresponse="true" resultpath="results" resultfile="TestResults2.xml" autoRefresh="true" > </config> <steps> <invoke url="/pageTest.jsp"/> <verifytitle text="page test" /> <setinputfield name="txtField1" value="Changed Value"/> <sleep seconds="8"/> <verifyinputfield stepid="Checks for the existence of an Input element named txtField1 enclosing Previous" name="txtField1" value="Previous Value" /> </steps> </testSpec>
In the testspec I have given a sleep so that the page will refresh. But the TestSpec fails and after sleep the value in txtfield1 is not changed and I get the error as
BUILD FAILED Test step verifyinputfield (E:\Installable\WebTest\AutoRefreshStep.xml:37: ) named "Checks for the existence of an Input element named txtField1 enclosing Previous" failed with message "Step "verifyinputfield "Checks for the existence of an Input element named txtField1 enclosing Previous" (6/7): Wrong contents found in input field: txtField1 Expected <Previous Value> but got <Changed Value>"
Can any body help in this




