verifyText just does a search through the source.  If you go to your ajax page 
and do a view source can you do a search through that and find the string you 
want?  If not then your problem is similar to one I've run across; that since 
verifyText works against the source it won't find ajax loaded content.  I have 
inserted a sleep to wait for ajax to load then use verifyXPath to verify 
whatever text is on the page that I want to verify.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of av8r
Sent: Tuesday, September 09, 2008 6:25 PM
To: [email protected]
Subject: [Webtest] Webtest and AJAX


Hi,

I am having problems with the webtest and ajax. We are using XMLHttpRequest 
with responses coming back as responseText. However, it does not seem to be 
working.
Everything seems to be going fine except when I get to the verifyText step.
The text
is missing, and instead the default text gets saved. Seems like the AJAX stuff 
is not working even though all the steps till the verifyText all get executed 
correctly. I am on build 1716 and using htmlunit-2.2.

<config easyajax="true"/>
   <steps>
       <property name="first_name" value="Eddie"/>
       <property name="last_name" value="Nettleton"/>
       &loginAndStep;

       <echo message="Schedule a call"/>
       <clickLink label="Calendar"/>
       <clickLink label="Schedule Call"/>
       <setInputField name="name" value="Call China office"/>
       <setSelectField name="duration_minutes" text="45"/>
       <setSelectField htmlid="parent_type" text="Case"/>
       <setSelectField htmlid="parent_type" text="Contact"/>

        <!-- Trying to figure out AJAX stuff here -->
        <selectForm name="EditView" />
        <clickElement htmlId="parent_name"/> <!-- Focus on the textbox -->
        <sleep seconds="5"/> <!-- Wait for AJAX response -->
        <setInputField htmlId="parent_name" value="${first_name} 
${last_name}"/> <-- Search & set name-->

        <clickButton description="Now click on Save" label="Save"/>
        <verifyText description="Check if page has related to stuff"
text="${first_name}> <!-- FAILS HERE -->
        <clickLink label="Logout"/>
   </steps>
--
View this message in context: 
http://www.nabble.com/Webtest-and-AJAX-tp19403354p19403354.html
Sent from the WebTest mailing list archive at Nabble.com.

_______________________________________________
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