Hello,
I am trying to use WebTest for our application test cases automation. Our
application landing page loading happens in two phases and it takes little more
time to complete app.
Webtest thinks page is loaded with first part of the application is loaded,
until all parts of application is loaded our app does not allow user to click
on Login link.
WebTest is clicking on Login link before complete loading of application,
getting element not found error.
With Selenium I use waitForPageToLoad() function that way it works fine with
Selenium. Is there an equivalent of waitForPageToLoad() in webtest ?
Thanks
Ashok
Here is part of Login test code :
------------------------------------------------------
<macrodef name="Login" description="Login macro">
<attribute name="userid"/>
<attribute name="password"/>
<sequential>
<invoke description="Go to Landing page" url="http://hostname:portno/"/>
<verifytext descriptiopn="Verify landing page is loaded" text="Results
for landing page"/>
<sleep seconds="10" />
<retry description="Retry until Login link is displayed" maxcount="2">
<sleep seconds="2" />
<invoke description="Reload the page after landing page"
url="http://hostname:portno/"/>
<verifyXPath description="Verify Login link element is present."
xpath="//[EMAIL PROTECTED]'Login']"/>
</retry>
<!-- <clickElement xpath="//[EMAIL PROTECTED]'Login']"/> -->
<clickLink htmlId="show2"/>
<setInputField description="Set username" htmlId="usrnamefield"
value="@{userid}"/>
<setInputField description="Set password" htmlId="usrpasswordfield"
value="@{password}"/>
<clickButton description="Click on Login button" xpath="//[EMAIL
PROTECTED]' Log In ']"/>
<retry description="Retry until Logout link is displayed" maxcount="10">
<sleep seconds="1" />
<invoke description="Reload the page after logout"
url="http://hostname:portno/"/>
<verifyXPath description="Verify Logout element is present."
xpath="//[EMAIL PROTECTED]'Logout']"/>
</retry>
</sequential>
</macrodef>
----------------------------------------------------------------------
_________________________________________________________________
Climb to the top of the charts! Play the word scramble challenge with star
power.
http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_jan