In LeanFT you can use an Assert method to check an objects and values.With an Assert method, you can use various functions to check objects and values. Check out the screenshots. I've thrown together a quick example on how to use it below.
![alt text][1] ![alt text][2]
This example will open a Firefox browser and navigate to Google.com. Then it will perform a search on ''eyeontesting'', which Google will promptly assume I'm actually trying to search for ''eye testing''. My assert statement is going to check the ''Showing Results for'' section to ensure it says, ''Showing results for eye testingSearch instead for eyeontesting'' by using Assert.AreEqual method.
(By the way, this code uses an insight object, for details on that see this post: [http://eyeontesting.com/questions/9745/does-leanft-have-an-insight-capability-like-uft-do.html)][3]
[TestInitialize]
public void TestInitialize()
{
//Create a browser object of type FireFox
IBrowser browser = BrowserFactory.Launch(BrowserType.Firefox);
browser.Navigate(''http://www.google.com'');
var searchField = browser.Describe(new EditFieldDescription
{
Type = @''text'',
TagName = @''INPUT'',
Name = @''q''
});
string bitmapFolder = ''Z:\Passport\Development\Visual Studio 2013\Projects\LeanFT\LeanFT_Web_Sandbox\LeanFT_Web_Sandbox\images\googleSearch.png'';
Image image = Image.FromFile(bitmapFolder);
var searchButton = browser.Describe(new InsightDescription(image));
searchField.SetValue(''eyeontesting'');
searchButton.Click();
string searchResultValue = ''Showing results for eye testingSearch instead for eyeontesting'';
var resultText = browser.Describe(new WebElementDescription
{
TagName = @''DIV'',
InnerText = As.RegExp(@''Showing results for .*''),
Index = 1
});
Assert.AreEqual(searchResultValue, resultText.InnerText);
Reporter.ReportEvent(''Result Check'', ''searchResultValue = '' + searchResultValue + '' resultText.InnerText = '' + resultText.InnerText);
}
[1]: /storage/temp/353-asssert1.png
[2]: /storage/temp/354-asssert2.png
[3]: http://eyeontesting.com/questions/9745/does-leanft-have-an-insight-capability-like-uft-do.html)