问题标签 [white-framework]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
c# - 白色 UIAutomation click() 停止在不同平台上工作
我正在使用White自动化 C# WPF UI 的 BDD 测试。
我的前几个测试在我的开发机器(运行 Windows 7)上运行良好。但是,当我尝试在构建服务器(运行 Windows Server 2003 R2 的虚拟机)上运行相同的代码时,它无法正常工作。在这两种情况下,测试都是从命令行运行的,并且测试使用的是 Cuke4Nuke 框架。对于服务器,我通过远程桌面连接访问服务器。
代码如下所示:
问题是按钮单击事件在服务器上运行时不会触发。如果在 White 完成执行后 UI 保持打开状态,则可以单击该按钮(使用鼠标)。有趣的一点是,在运行 click 方法后,按钮确实显示了被单击的证据,如下图所示,在其他按钮的情况下,显示了鼠标悬停效果。
c# - WPF,白色自动化,拖放挂起
我目前正在尝试使用White UI-Automation framework自动化测试用例。
在这样做时,我在拖放时遇到了一些麻烦。我试图从一个按钮拖动到屏幕上的一个点,我根据另外两个点的位置来计算。
发生的情况是单击按钮并且鼠标移动到正确的位置,然后应用程序挂起,直到手动移动或单击鼠标,然后发生下降并继续测试。如果鼠标没有收到任何手动交互,则应用程序继续挂起。
代码如下所示:
最后一行之后的任何代码都不会执行。
提前感谢您的帮助。
continuous-integration - 如何运行 White + Teamcity(Winforms 应用程序)
我正在尝试运行 UI 测试(使用白色编写)。当我使用 NUnitConsole 运行它们时,一切正常。当我尝试使用 TeamCity 运行它们时,出现以下异常Test(s) failed. White.Core.UIItems.UIActionException : Couldn't find window with title Form1 in process 4132, after waiting for 5000 ms
。可能有什么问题?我该怎么做才能使测试通过?
c# - C:\windows\assembly 中缺少 System.Diagnostics.ProcessStartInfo'
我从未在 C# 中创建过任何项目。我试图弄清楚如何将 White 与 MS UI 自动化库一起使用,但它缺少对 System.Diagnostics.ProcessStartInfo 的引用。即使我已经安装了 Windows 的 SDK,我也无法在 C:\Windows\Assembly 中找到它。这是我尝试运行的代码和平:
我得到的错误代码:错误CS0012:类型'System.Diagnostics.ProcessStartInfo'是在未引用的程序集中定义的。您必须添加对程序集“System,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089”的引用。(CS0012) (WhiteTests)
我应该怎么做才能获得对 System.Diagnostics.ProcessStartInfo 的引用?我不是 Windows 专家。
Firstable 我忘了补充说我正在使用 MonoDevelop。有其他 IDE 我可以检查吗?我不确定我是否会获得 MS Studio 的许可证。我设置了参考,这次我遇到了 System.core 的问题:
错误 CS0234:命名空间“System”中不存在类型或命名空间名称“Core”(您是否缺少程序集引用?) (CS0234) (WhiteTests)
但是这个库在 C:\Windows\assembly 目录中列出。
testing - Test automation - Win32 app - White/UI automation - problem with recognizing objects
I’m looking for alternative for existing tests written in QTP for my Win32 application written in Borland C++. My candidate is White which based on UI Automation because it’s native solution, I can create my tests using .NET/C# and easily integrate it with nUnit and Hudson.
White http://white.codeplex.com
MS UI Automation http://msdn.microsoft.com/en-us/library/ms747327.aspx
UI Verify http://uiautomationverify.codeplex.com
I use UI Verify as a spy to identify properties of objects I want to find in my tests. More or less when I can see something in the spy, I can find it using UI Automation/White. Generally I don't have much problems with recognizing objects but when I try to search some content inside the tab contained in Tab Panel or try to see MenuItems of Menu bar then the problem appears.
UI Automation/UI Verify works wired. When I run UI Verify (1.0 version) I see that objects can be registered properly only then when I set 'Focus tracking' option and click on target objects or change the keyboard cursor on them. Otherwise it's impossible to find them. UI Verifier can show me children of my 'tab' panel then. But I can’t find them using UI Automation/White. This is example code:
Tab tab = window.Get(); ITabPage tabPage = tab.SelectedTab; AutomationElementCollection newCol = tabPage.AutomationElement.FindAll(TreeScope.Descendants, Condition.TrueCondition); window.Get("buttonName");
the collection is empty even though spy see the children.
- Does any of you have some experience with White/UI Automation library that he/she would like to share with me?
- I want to implement the tracking feature from the spy to my tests. Can you help me with that? I'm trying to study the code of UIA Verify spy. I think that there are two classes responsible for catching the objects: FocusChangeListener and FocusTracer - this is the code:
http://uiautomationverify.codeplex.com/SourceControl/changeset/view/9992#214260 http://uiautomationverify.codeplex.com/SourceControl/changeset/view/9992#214192
Requirements: 1. Windows SDK 2. .NET 3.5 3. White 4. UIA Verify code
- Do you have any better alternative for White/UI Automation?
R.
performance - VS2010 使用 Gallio 调试自动化 HMI 测试非常慢
当我尝试在一个非常特定的测试配置中观察一个变量时,我看到一个问题,Visual Studio 冻结了 30 多秒,这让我很抓狂。调试主应用程序或非 hmi 单元测试时未出现此问题
我们使用 Visual Studio 2010、Gallio 3.2 和 White 0.2(使用 Icarus Test Runner 或 Resharper)运行自动化 HMI 测试,有时我们喜欢调试它们 :-) 目标平台是 .Net 4.0 和 x86,我是在 Windows 7 x64 上开发。这种设置引起了我们克服的各种问题。
在我疯狂的挣扎以解决我尝试过的问题:
- 使用 CorFlags 强制所有 Gallio 应用程序作为 32 位应用程序运行——(修复了单元测试问题)
- 禁用 Resharper - 没有结果
- 禁用异常助手——无结果
- 禁用属性评估 -- 无结果
- 创建本地符号缓存——无结果
- 在 IsolatedProcess/IsolatedAppdomain/Local 之间更改应用程序的隔离级别 - 无法作为独立进程运行,否则无结果。
- 以管理员身份运行 Icarus 和 Visual Studio - 无结果
- 将调试器附加到 Visual Studio 本身——是的!
唯一有所作为的是将调试器附加到 Visual Studio 本身,然后它会非常愉快地运行。在调试 Visual Studio 时,控制台上会喷出各种杂物,但似乎没有与该问题相关。
有人知道发生了什么或对解决方案有任何建议吗?
谢谢
wpf - 如何获取 White.Core.UIItems.WindowItems.Window 的实例,它可以自动化在集成测试中创建的 WPF 窗口?
我使用White自动化框架创建了一个集成测试。这是集成测试的开始:
但是,我想获得一个White.Core.UIItems.WindowItems.Window
在新进程中不“启动”应用程序的实例。然后,这将允许我注入任何MainWindow
具有的依赖项,以便我可以有选择地模拟/存根它们。
作为我正在寻找的一个例子,这是我希望我能写的代码:
有什么方法可以使用 White 自动化框架实现这一目标?
c# - C# 等待用户与 White 的交互
我正在考虑将 White 用于我的简单 windows ui 自动化。首先,我使用System.Diagnostics.Process
. 当外部应用程序打开时会给我一个对话框,用户在其中插入一些文本并单击 OK 按钮。我需要等到对话框关闭或检测到单击确定按钮。我所需要的只是一些迹象表明用户已完成该对话框,我可以继续我的自动化任务。
有什么办法可以用白做吗?也欢迎任何其他选择!
c# - 如何通过 ClassID 找到应用程序窗口?
我正在使用White进行测试自动化。我创建了简单的应用程序测试,它通过它的对话框名称跟踪应用程序。
但是这种方法是不稳定的,因为在不同的本地化中,标题可能会有所不同。我如何使用它的 ClassID 跟踪我的应用程序?
wpf - 用于测试 WPF 应用程序 UI 的白色框架文档和示例
我打算使用带有 NUnit 的 White 框架来测试我的 WPF 应用程序。可从http://white.codeplex.com下载的程序集 zip 我为程序集下载的 zip 有一个文档 NDoc 文件夹。该文档似乎是从代码自动生成的。并且没有评论提供任何关于如何使用 API 获取 WPF 控件或对其执行任何操作的提示。请向我指出任何示例,以便我可以使用此框架。
我已经尝试过搜索自己,除了这篇基于旧版 White 框架的文章,我没有找到任何其他内容。 http://blogs.msdn.com/b/john_daddamio/archive/2008/04/04/testing-wpf-applications-with-the-white-ui-test-framework.aspx