qr code c# Silverlight test autom ation in C#

Drawer QR Code in C# Silverlight test autom ation

Silverlight test autom ation
QR Code JIS X 0510 Drawer In C#
Using Barcode maker for .NET Control to generate, create QR image in .NET applications.
www.OnBarcode.com
QR Code JIS X 0510 Decoder In Visual C#
Using Barcode recognizer for Visual Studio .NET Control to read, scan read, scan image in .NET applications.
www.OnBarcode.com
Silverlight has a gained considerable momentum in the .NET world. It s an exceptional technology that mixes web availability and Windows responsiveness. It lets .NET developers use the knowledge they already have to build a web application to create a Windows style application. Figure 7.7 shows the financial calculator as a Silverlight application. We won t walk you through the creation of this application, but we provide full source code with this book. Testing a Silverlight application in White is as easy as testing a Windows application. You again use NUnit to perform the test. The following listing shows how to set up White to test your Silverlight application.
Barcode Encoder In C#
Using Barcode encoder for .NET Control to generate, create Barcode image in .NET applications.
www.OnBarcode.com
Drawing 2D In C#
Using Barcode drawer for Visual Studio .NET Control to generate, create 2D image in .NET applications.
www.OnBarcode.com
Testing the user interface
Painting EAN 13 In Visual C#
Using Barcode generation for .NET framework Control to generate, create European Article Number 13 image in .NET applications.
www.OnBarcode.com
Barcode Generator In Visual C#
Using Barcode creation for VS .NET Control to generate, create Barcode image in .NET framework applications.
www.OnBarcode.com
Figure 7.6 If you want your CI server to be able to test the Windows GUI, you have to allow it to interact with the desktop.
Denso QR Bar Code Encoder In C#
Using Barcode generation for Visual Studio .NET Control to generate, create QR Code 2d barcode image in VS .NET applications.
www.OnBarcode.com
EAN8 Printer In C#
Using Barcode printer for VS .NET Control to generate, create EAN / UCC - 8 image in .NET framework applications.
www.OnBarcode.com
Figure 7.7 The example financial calculator running as a Silverlight application
QR Code ISO/IEC18004 Generator In Objective-C
Using Barcode creator for iPad Control to generate, create Denso QR Bar Code image in iPad applications.
www.OnBarcode.com
Denso QR Bar Code Creator In Java
Using Barcode maker for Android Control to generate, create QR-Code image in Android applications.
www.OnBarcode.com
184 Listing 7.8
Creating PDF-417 2d Barcode In Java
Using Barcode generator for Android Control to generate, create PDF-417 2d barcode image in Android applications.
www.OnBarcode.com
UPC-A Maker In .NET
Using Barcode encoder for ASP.NET Control to generate, create UPC-A Supplement 5 image in ASP.NET applications.
www.OnBarcode.com
[TestFixture]
Print Barcode In Java
Using Barcode encoder for Android Control to generate, create Barcode image in Android applications.
www.OnBarcode.com
Creating Barcode In Java
Using Barcode creation for Java Control to generate, create Barcode image in Java applications.
www.OnBarcode.com
Perform ing integration, system , and acceptance testing
UCC.EAN - 128 Drawer In Java
Using Barcode creator for Eclipse BIRT Control to generate, create EAN / UCC - 14 image in BIRT reports applications.
www.OnBarcode.com
UCC-128 Encoder In .NET
Using Barcode generation for ASP.NET Control to generate, create UCC - 12 image in ASP.NET applications.
www.OnBarcode.com
Automating UI testing of a Silverlight application
Encode EAN / UCC - 13 In Objective-C
Using Barcode maker for iPad Control to generate, create GTIN - 128 image in iPad applications.
www.OnBarcode.com
Barcode Maker In None
Using Barcode printer for Microsoft Excel Control to generate, create Barcode image in Office Excel applications.
www.OnBarcode.com
public class SilverlightCalcUiTestFixture { InternetExplorerWindow _browserWindow; [SetUp] public void SetUp() { _browserWindow = InternetExplorer.Launch("http://localhost:52661/
Painting USS Code 128 In .NET Framework
Using Barcode printer for Visual Studio .NET Control to generate, create USS Code 128 image in Visual Studio .NET applications.
www.OnBarcode.com
USS Code 128 Creation In Visual Basic .NET
Using Barcode drawer for Visual Studio .NET Control to generate, create Code128 image in .NET framework applications.
www.OnBarcode.com
CiDotNet.SilverlightCalcTestPage.aspx", "CiDotNet.SilverlightCalc - Windows Internet
} [TearDown] public void TearDown() { _browserWindow.Dispose(); } [Test]
Explorer");
public void Test() { SilverlightDocument document = _browserWindow.SilverlightDocument; Button button = document.Get<Button>("btnCalculate"); button.Click(); System.Threading.Thread.Sleep(5000); TextBox rateTextBox = document.Get<TextBox>("txtRate"); Assert.AreEqual(rateTextBox.Text, "878,754159722056"); } }
Testing the Silverlight application is as straightforward as testing a Windows application. In the SetUp method, you launch Microsoft Internet Explorer with your Silverlight application. In TearDown, you close the browser. In the test method, you first get the Silverlight document from the page; the test is similar to the WinForms app you tested earlier. White comes with a ton of neat additional features. For example, it has the ability to reuse a test in multiple test scenarios. This means you don t have to search the controls on the GUI using the Get() methods. The controls are generated and provided to you in strongly typed fashion. Detailed usage of White isn t a topic of this book, so we won t cover the extended features any further, but we encourage you to explore it. It s well worth your time! You ve tested a Windows application and a Silverlight-powered website. How about an ordinary website White won t help you there. But you can use another tool, Selenium, to test websites.
Testing the user interface
Testing a w eb application w ith Selenium
Selenium is a web application testing framework that originally came from ThoughtWorks. It s a set of tools, including the Selenium IDE, which is a Firefox plug-in that helps to record and play the test, and Selenium RC, a remote control to perform tests for various browsers from various languages. You can get Selenium from http:// seleniumhq.org/. It automatically installs; after a restart, you ll have one additional item on the Tools menu: Selenium IDE. Let s automatically test the web financial calculator, shown in figure 7.8. You ll do exactly the same test you did with the Windows and Silverlight applications, but you ll use Selenium IDE to record the test. First, get the Firefox web browser (www.firefox.com/) if you don t already have it. You ll only need it on your development machine because the Selenium IDE is a Firefox plug-in. To install it, use Firefox: go to http://seleniumhq.org/, browse to the download, and click the link to an .xpi file. This is the plug-in file for Firefox. When you click it, Firefox prompts you to allow the installation. Do so, and restart Firefox. Run the web financial calculator from Visual Studio. Doing so launches the ASP.NET development server. Now, launch Firefox, and navigate to the URL of your application. Start the Selenium IDE from the Firefox Tools menu. You ll get the empty test suite shown in figure 7.9. Be sure the button is selected, and you re good to go. Enter some values into the calculator, and click the Calculate button. Selenium, by default, records all your clicks and keystrokes and places them in a table (see figure 7.10).
Copyright © OnBarcode.com . All rights reserved.