This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
using TestStack.White; | |
using TestStack.White.Factory; | |
using TestStack.White.UIItems.Finders; | |
using TestStack.White.UIItems.MenuItems; | |
using TestStack.White.UIItems.WindowItems; | |
namespace UnitTestProject1 | |
{ | |
[TestClass] | |
public class UnitTest1 | |
{ | |
[TestMethod] | |
public void TestMethod1() | |
{ | |
var applicationName = "notepad.exe"; | |
Application application = Application.Launch(applicationName); | |
var window = application.GetWindow("Untitled - Notepad"); | |
var menubar = window.MenuBars[1]; | |
var file = menubar.MenuItem("File"); | |
file.Click(); | |
var fx = window.Popup; //submenus are implemented as Popup menu for Notepad | |
var exitMenuItem = fx.Item("Exit"); | |
exitMenuItem.Click(); | |
} | |
} | |
} |
No comments:
Post a Comment