本文整理汇总了C#中TestStack.White.UIItems.WindowItems.Window类的典型用法代码示例。如果您正苦于以下问题:C# Window类的具体用法?C# Window怎么用?C# Window使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Window类属于TestStack.White.UIItems.WindowItems命名空间,在下文中一共展示了Window类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: GetBaseCondiction
public static CondictionScript GetBaseCondiction(AutomationElement element,Window rootWindow)
{
var walker =
new System.Windows.Automation.TreeWalker(
System.Windows.Automation.Condition.TrueCondition);
System.Windows.Automation.AutomationElement testparent;
var baseCondiction = new CondictionScript();
var paths=new List<AutomationElement>();
GetPath(element, rootWindow, walker, paths);
int flag = AnalyseSimpleCondiction(paths, rootWindow, baseCondiction);
if(flag>0)
{
return baseCondiction;
}
else if(flag==0)
{
return new CondictionScript();
}
else
{
return null;
}
}
开发者ID:suriyel,项目名称:XtmatRT,代码行数:27,代码来源:BaseWindowFinder.cs
示例2: New
public virtual object New(Window window, ScreenRepository screenRepository)
{
var o = Activator.CreateInstance(type, window, screenRepository);
//Get all fields, even from base types
var fieldInfos = AllTypes(type).SelectMany(t=>t.GetFields(Entity.BindingFlag));
foreach (var fieldInfo in fieldInfos)
{
if (nonInjectedTypes.Any(t=>t.IsAssignableFrom(fieldInfo.FieldType))) continue;
object injectedObject = null;
if (typeof(IUIItem).IsAssignableFrom(fieldInfo.FieldType))
{
var interceptor = new UIItemInterceptor(SearchCondition(fieldInfo, window.Framework), window, screenRepository.SessionReport);
injectedObject = DynamicProxyGenerator.Instance.CreateProxy(fieldInfo.FieldType, interceptor);
}
else if (typeof(AppScreenComponent).IsAssignableFrom(fieldInfo.FieldType))
{
var componentScreenClass = new ScreenClass(fieldInfo.FieldType);
injectedObject = componentScreenClass.New(window, screenRepository);
}
if (injectedObject != null) fieldInfo.SetValue(o, injectedObject);
}
return o;
}
开发者ID:EDOlsson,项目名称:White,代码行数:26,代码来源:ScreenClass.cs
示例3: Reset
/// <summary>
/// reset action after executing
/// </summary>
public override void Reset()
{
base.Reset();
Window = null;
Control = null;
}
开发者ID:divyang4481,项目名称:dotnetabt,代码行数:10,代码来源:UIAAction.cs
示例4: ClassInit
public static void ClassInit(TestContext context)
{
var applicationPath = "WhiteTest.exe";
application = Application.Launch(applicationPath);
window = application.GetWindow("MainWindow", InitializeOption.NoCache);
}
开发者ID:krzysztofstudniarek,项目名称:WindowsFormsFunctionalTestsExample,代码行数:7,代码来源:FunctionalTests.cs
示例5: FindControl
/// <summary>
/// given a criteria, find a control within a window
/// </summary>
/// <param name="window">the containing window</param>
/// <param name="criteria">the criteria to find the control</param>
/// <returns>the found control. null - if not found</returns>
public IUIItem FindControl(Window window, Dictionary<string, string> criteria)
{
// the "all" condition
SearchCriteria crit = SearchCriteria.All;
// for each criteria, AND with a new condition
foreach (string key in criteria.Keys)
{
switch (key.ToLower())
{
//case Constants.PropertyNames.ControlType:
// crit = crit.AndControlType(GetTypeByName(criteria[key]));
// break;
case Constants.PropertyNames.AutomationId:
crit = crit.AndAutomationId(criteria[key]);
break;
case Constants.PropertyNames.Text:
crit = crit.AndByText(criteria[key]);
break;
case Constants.PropertyNames.ClassName:
crit = crit.AndByClassName(criteria[key]);
break;
case Constants.PropertyNames.Index:
crit = crit.AndIndex(int.Parse(criteria[key]));
break;
default:
{
bool bNativeFound = false;
AutomationProperty[] props = window.AutomationElement.GetSupportedProperties();
foreach (AutomationProperty prop in props)
{
string propName = prop.ProgrammaticName.Substring(prop.ProgrammaticName.IndexOf('.') + 1);
propName = propName.Substring(0, propName.IndexOf("Property"));
if (propName.Equals(key, StringComparison.CurrentCultureIgnoreCase))
{
crit.AndNativeProperty(prop, criteria[key]);
bNativeFound = true;
break;
}
}
if (bNativeFound)
break; ;
}
return null;
};
}
try
{
// search for control with 'crit'
IUIItem item = window.Get(crit, WaitTime);
// return the found control
return item;
}
catch(Exception)
{
return null;
}
}
开发者ID:divyang4481,项目名称:dotnetabt,代码行数:66,代码来源:UIAActionManager.cs
示例6: CheckWindowExists
//**************************************************************************************************************************************************************
public static bool CheckWindowExists(Window mainWindow, string childWindowName)
{
bool window = false;
try
{
List<Window> allChildWindows = mainWindow.ModalWindows();
foreach (Window w in allChildWindows)
{
if (w.Name.Equals(childWindowName) || w.Name.Contains(childWindowName))
{
window = true;
Thread.Sleep(int.Parse(Execution_Speed));
break;
}
}
return window;
}
catch (Exception e)
{
String sMessage = e.Message;
LastException.SetLastError(sMessage);
throw new Exception(sMessage);
}
}
开发者ID:nhaloi,项目名称:QBWhiteFramework,代码行数:28,代码来源:Actions.cs
示例7: FindControl
/// <summary>
/// given a criteria, find a control within a window
/// </summary>
/// <param name="window">the containing window</param>
/// <param name="criteria">the criteria to find the control</param>
/// <returns>the found control. null - if not found</returns>
public IUIItem FindControl(Window window, Dictionary<string, string> criteria)
{
// the "all" condition
SearchCriteria crit = SearchCriteria.All;
// for each criteria, AND with a new condition
foreach (string key in criteria.Keys)
{
switch (key.ToLower())
{
case Constants.PropertyNames.ControlType:
crit = crit.AndControlType(GetTypeByName(criteria[key]));
break;
case Constants.PropertyNames.AutomationId:
crit = crit.AndAutomationId(criteria[key]);
break;
case Constants.PropertyNames.Text:
crit = crit.AndByText(criteria[key]);
break;
default:
return null;
};
}
// search for control with 'crit'
IUIItem item = window.Get(crit, WaitTime);
// return the found control
return item;
}
开发者ID:divyang4481,项目名称:dotnetabt,代码行数:36,代码来源:UIAActionManager.cs
示例8: Initialize
public void Initialize()
{
qbApp = FrameworkLibraries.AppLibs.WhiteAPI.QuickBooks.Initialize(exe);
qbWindow = FrameworkLibraries.AppLibs.WhiteAPI.QuickBooks.PrepareBaseState(qbApp);
QuickBooks.ResetQBWindows(qbApp, qbWindow, false);
InitQB();
}
开发者ID:vincentraj,项目名称:QBSilk4NetWhiteFramework,代码行数:7,代码来源:US_Regression_CommentedReports.cs
示例9: Slide
public void Slide(Window window)
{
var thumb = window.Get<Thumb>("Splitter");
var originalY = thumb.Location.Y;
thumb.SlideVertically(50);
Assert.Equal(originalY + 50, thumb.Location.Y);
}
开发者ID:EricBlack,项目名称:White,代码行数:7,代码来源:VerticalThumbTest.cs
示例10: Slide
public void Slide(Window window)
{
var thumb = window.Get<Thumb>("Splitter");
double originalX = thumb.Location.X;
thumb.SlideHorizontally(50);
Assert.Equal(originalX + 50, thumb.Location.X);
}
开发者ID:EricBlack,项目名称:White,代码行数:7,代码来源:HorizontalThumbTest.cs
示例11: DeskSelectionModel
public DeskSelectionModel(Window window)
{
deskSelection = window.Get<ComboBox>(SearchCriteria.ByAutomationId(DeskSelectionIDs.DESKSELECTIONCOMBOBOX));
makeMeImmediatlyAvailable = window.Get<CheckBox>(SearchCriteria.ByAutomationId(DeskSelectionIDs.MAKEMEIMMEDIATELYAVAILABLECHECKBOX));
okButton = window.Get<Button>(SearchCriteria.ByAutomationId(DeskSelectionIDs.OKBUTTON));
cancelButton = window.Get<Button>(SearchCriteria.ByAutomationId(DeskSelectionIDs.OKBUTTON));
closeButton = window.Get<Button>(SearchCriteria.ByAutomationId(DeskSelectionIDs.CLOSEBUTTON));
}
开发者ID:ZeroTull,项目名称:EC4,代码行数:8,代码来源:DeskSelectionModel.cs
示例12: CleanUp
public void CleanUp()
{
_mainWindow.Close();
_application.Dispose();
_application = null;
_mainWindow = null;
}
开发者ID:hemantksingh,项目名称:MusicManager,代码行数:8,代码来源:Given_menu_option_select_mp3_files_is_selected.cs
示例13: TestInitialize
public void TestInitialize()
{
qbApp = FrameworkLibraries.AppLibs.QBDT.WhiteAPI.QuickBooks.Initialize(exe);
qbWindow = FrameworkLibraries.AppLibs.QBDT.WhiteAPI.QuickBooks.PrepareBaseState(qbApp);
QuickBooks.ResetQBWindows(qbApp, qbWindow);
invoiceNumber = rand.Next(12345, 99999);
poNumber = rand.Next(12345, 99999);
}
开发者ID:nhaloi,项目名称:QBWhiteFramework,代码行数:8,代码来源:TestCommentedReports.cs
示例14: Initialize
public void Initialize()
{
Logger test = new Logger("US_Commented_Reports_Test");
qbApp = FrameworkLibraries.AppLibs.WhiteAPI.QuickBooks.Initialize(exe);
qbWindow = FrameworkLibraries.AppLibs.WhiteAPI.QuickBooks.PrepareBaseState(qbApp);
QuickBooks.ResetQBWindows(qbApp, qbWindow, false);
InitQB();
}
开发者ID:vincentraj,项目名称:QBSilk4NetWhiteFramework,代码行数:8,代码来源:US_Sanity_CommentedReports.cs
示例15: OperationsPage
public OperationsPage(Window window)
{
this.window = window;
string[] operations = { "*", "/", "-", "+", "=" };
operationButtons = operations.ToDictionary(o => o, o => window.Get<Button>(SearchCriteria.ByText(o)));
}
开发者ID:jazz-any,项目名称:CalcUT,代码行数:8,代码来源:OperationsPage.cs
示例16: LoginModel
public LoginModel(Window loginWindow)
{
loginTextBox = loginWindow.Get<TextBox>(SearchCriteria.ByAutomationId(LoginWindowIDs.LOGINTEXTBOX));
passwordField = loginWindow.Get<TextBox>(SearchCriteria.ByAutomationId(LoginWindowIDs.PASSWORDTEXTBOX));
clientField = loginWindow.Get<TextBox>(SearchCriteria.ByAutomationId(LoginWindowIDs.CLIENDTEXTBOX));
rememberMeCheckBox = loginWindow.Get<CheckBox>(SearchCriteria.ByClassName(LoginWindowIDs.REMEMBERMECHECKBOX));
loginButton = loginButton = loginWindow.Get<Button>(SearchCriteria.ByAutomationId(LoginWindowIDs.LOGINBUTTON));
}
开发者ID:ZeroTull,项目名称:EC4,代码行数:8,代码来源:LoginModel.cs
示例17: WhiteWindowShim
internal WhiteWindowShim(Window whiteWindow)
{
this._white = whiteWindow;
try
{
if (_white.Exists<Label>())
_text = _white.Get<Label>().Text;
}
catch { }
}
开发者ID:peterson1,项目名称:ErrH,代码行数:10,代码来源:WhiteWindowShim.cs
示例18: ResultPage
public ResultPage(Window window)
{
this.window = window;
var edits = window.GetMultiple(SearchCriteria.ByControlType(ControlType.Edit)).Cast<TextBox>().ToArray();
resultField = edits.First(edit => edit.Text == "0");
resultScreen = edits.First(edit => edit != resultField);
resultButton = window.Get<Button>(SearchCriteria.ByText("="));
okButtonCriteria = SearchCriteria.ByText("OK");
}
开发者ID:jazz-any,项目名称:CalcUT,代码行数:10,代码来源:ResultPage.cs
示例19: SetUp
public void SetUp()
{
var applicationDirectory = TestContext.CurrentContext.TestDirectory;
var applicationPath = Path.Combine(applicationDirectory, "AvalonCalculator.exe");
Application application = Application.Launch(applicationPath);
window = application.GetWindow("WPF Calculator", InitializeOption.NoCache);
numbersPage = new NumbersPage(window);
operationsPage = new OperationsPage(window);
resultPage = new ResultPage(window);
}
开发者ID:jazz-any,项目名称:CalcUT,代码行数:11,代码来源:Test.cs
示例20: NumbersPage
public NumbersPage(Window window)
{
var symbolToButtonNameMappings = Enumerable.Range(0, 10)
.Select(i => i.ToString()).Concat(new [] {"." })
.ToDictionary(i => i, i => i);
symbolToButtonNameMappings["-"] = "+/-";
symbolButtons = symbolToButtonNameMappings
.ToDictionary(mapping => mapping.Key,
mapping => window.Get<Button>(SearchCriteria.ByText(mapping.Value)));
}
开发者ID:jazz-any,项目名称:CalcUT,代码行数:11,代码来源:NumbersPage.cs
注:本文中的TestStack.White.UIItems.WindowItems.Window类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论