Yes, testing non-Ajax forms is supported. We use LTAF to test regular webforms, MVC and other sites that have no javascript at all. Could you explain a little bit more what scenario is not working for you?
It's called "postback" simply because it is a more natural term for ASP.NET developers, but it's really wait until a new page is loaded to continue. Does that work for you?
Regarding tools, unfortunately we don't have a test recorder like Selenium. LTAF is mantained by the ASP.NET QA team (we are not full time devs of LTAF :P) and we haven't seen the need to create one yet.
Thanks for your interest in LTAF, let me know if you have any more questions or suggestions on how we can improve the framework.
- Federico
Marked as answer by osbornm on Oct 10, 2009 12:09 AM
fabiomilheir...
Member
38 Points
35 Posts
Testing non-ajax forms
Aug 30, 2009 01:18 PM|LINK
I have seen that LTAF is great to test Ajax forms, but can we also test non-Ajax forms with it?
I tried to do that, but I cannot find the url of the second form (I need to know it in order to test if the test is successful or not)
Thank you!
forms
akmsaeea
Participant
1053 Points
205 Posts
Re: Testing non-ajax forms
Aug 31, 2009 04:52 AM|LINK
Pls refer these links::
http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=28536
http://www.sontek.net/category/LTAF.aspx
http://weblogs.asp.net/asptest/archive/2009/06/10/what-s-new-in-ltaf-june-release.aspx
fabiomilheir...
Member
38 Points
35 Posts
Re: Testing non-ajax forms
Aug 31, 2009 11:45 AM|LINK
Thank you for your response, but none of these links provide a yes or a no to the question.
Have you tried to test non-ajax forms?
farmas
Participant
1164 Points
259 Posts
Microsoft
Re: Testing non-ajax forms
Sep 01, 2009 02:11 AM|LINK
Hello !
Yes, testing non-Ajax forms is supported. We use LTAF to test regular webforms, MVC and other sites that have no javascript at all. Could you explain a little bit more what scenario is not working for you?
- Federico
fabiomilheir...
Member
38 Points
35 Posts
Re: Testing non-ajax forms
Sep 03, 2009 09:02 PM|LINK
Frederico, let's imagine an Ajax form that calculates your age and the following test:
[WebTestMethod]
public void Can_Calculate_Age()
{
// Arrange
HtmlPage page = new HtmlPage("/AgeCalculator");
// Act
page.Elements.Find("currentYear").SetText("2010");
page.Elements.Find("yearOfBirth").SetText("1932");
page.Elements.Find("submitButton").Click();
// Assert
var resultsElement = page.Elements.Find("results");
resultsElement.WaitForInnerText("Your age is approximately: 78", ajaxRequestTimeoutSeconds);
}
As you can see, this test verifies that the result (in this case, presented in a div) is "Your age is approximately: 78".
What if this form is non-Ajax?
How do you wait for the result page to load and how do you find the url of that page?
By they way, is there any tools native to Visual Studio 2008 that is similar?
Can we record user experience with LTAF or that native tool I imagine as it is the case with the selenium plug-in for Firefox?
Thank you for taking the trouble to answer this questions!
farmas
Participant
1164 Points
259 Posts
Microsoft
Re: Testing non-ajax forms
Sep 03, 2009 09:16 PM|LINK
Oh, I see. There is an overload of the Click method that you want to use to wait until the postback is completed.
page.Elements.Find("submitButton").Click(WaitFor.Postback);
It's called "postback" simply because it is a more natural term for ASP.NET developers, but it's really wait until a new page is loaded to continue. Does that work for you?
Regarding tools, unfortunately we don't have a test recorder like Selenium. LTAF is mantained by the ASP.NET QA team (we are not full time devs of LTAF :P) and we haven't seen the need to create one yet.
Thanks for your interest in LTAF, let me know if you have any more questions or suggestions on how we can improve the framework.
- Federico