I am evaluating ways to test Ajax web pages.
I have found a sample of a test routine, in two web page test systems, and would like to know how it might be coded in WebAii.
The samples are:
Selenium
public void MinAndMaxPriceRestoredWhenOpenedAfterUsingBackButton(){
OpenBrowserTo("welcome/index.rails");
bot.Click("priceDT");
WaitForText("Price Range");
WaitForText("515 N. County Road");
bot.Select("MaxDropDownList", "$5,000,000");
WaitForText("Prewar 8 Off Fifth Avenue");
bot.Select("MinDropDownList", "$2,000,000");
WaitForText("of 86");
bot.Click("link=Prewar 8 Off Fifth Avenue");
WaitForText("Rarely available triple mint restoration");
bot.GoBack();
Thread.Sleep(20000);
bot.Click("priceDT");
WaitForText("Price Range");
Assert.AreEqual("$5,000,000", bot.GetSelectedLabel("MaxDropDownList"));
Assert.AreEqual("$2,000,000", bot.GetSelectedLabel("MinDropDownList"));}3.2)
WatiN
public void MinAndMaxPriceRestoredWhenOpenAfterUsingBackButton(){
OpenBrowserTo("welcome/index.rails");
ClickLink("Price");
SelectMaxPrice("$5,000,000");
SelectMinPrice("$2,000,000");
ClickLink("Prewar 8 Off Fifth Avenue")
GoBack();
ClickLink("Price");
Assert.AreEqual("$5,000,000", SelectedMaxPrice());
Assert.AreEqual("$2,000,000", SelectedMinPrice());}
In addition I'd like to know how the code would look where an action initiated an Ajax call (using jQuery) the callback of which changes page content. I then want to check the changes on the page.
Thanks.