使用System.Windows.Automation(通常称为UIA)API和Microsoft.VisualStudio.TestTools.UITesting(在场景后面的Coded UI Test中使用的API)以编程方式实现WPF应用程序的UI测试自动化有什么区别?
是否有任何特定的场景,限制或优点/缺点?
这是一种"高级"/简单的问题.我正在尝试获取VS2012中我的测试资源管理器中填充的所有测试的列表.我想将它与测试列表进行比较,我想知道是否有任何方法可以从测试资源管理器中获取所有名称,例如复制/粘贴,导出到csv或任何此类性质.
我们在当前项目中使用Specflow和WatIn进行验收测试.客户希望我们使用Microsoft编码的ui.我从来没有测试过编码的ui,但是到目前为止我看到它看起来很麻烦.我想在我有一个ui之前预先指定我的验收测试,而不是由于一些记录/回放的东西.无论如何,有人可以告诉我为什么我们应该扔掉Specflow/watin组合并用编码的ui替换它?
我还读过你可以将specflow和编码的ui结合起来,但对于我在specflow中已经做得很好的事情来说,它看起来很像开销.
我正在尝试在SharePoint 2010网站上使用Visual Studio 2010进行一些编码的UI测试.SharePoint中的特定文件在单独的窗口中启动我的Silverlight应用程序.我在所有运行它的Silverlight项目中添加了SilerlightUIAutomationHelper程序集作为参考.这应该允许我在其中记录操作,但当我尝试在Silverlight应用程序内部录制时会弹出一条错误消息:
No Silverlight controls were detected. Verify that the application under test
is built using Silverlight assemblies with a version of 4.0 or greater and that
a reference to the Microsoft.VisualStudio.TestTools.Extension.SilverlightUIAutomationHelper.dll
assembly has been added to the project.
Run Code Online (Sandbox Code Playgroud)
我正在运行Silverlight 5.0,所以这不是问题.我还验证了SilverlightUIAutomationHelper dll已经进入了xap包.
我已经能够使用此扩展在SharePoint 2013/Visual Studio 2012中成功记录这些操作:http://visualstudiogallery.msdn.microsoft.com/28312a61-9451-451a-990c-c9929b751eb4
知道为什么会这样吗?我该怎么办才能修复它?
在Visual Studio 2012中运行我的Coded UI测试后,我希望将测试结果记录到HTML文件中.按照本教程后,我能够实现这一目标.
不幸的是,每个测试都有自己的HTML报告..\TestResults\<Test Run Folder>\In\<Individual Test Log Folder>\<PC Name>\UITestActionLog.html,目前我有3个不同的单独测试,每个测试都有自己的文件夹..\TestResults\<Test Run Folder>\In\
每个生成的HTML文件如下所示:

我想要的是将所有3个HTML文件组合成一个,而不仅仅是
>测试1
它会是这样的
>测试1
>测试2
>测试3
有没有办法用一些配置选项自动执行此操作,还是我自己编写程序来合并所有HTML文件?
我运行MSTest来使用Teamcity在VM上测试WPF应用程序(Coded UI Test).我已经将测试代理安装为交互式进程,但我在Teamcity日志中不断收到此错误
Error calling Initialization method for test class Squarebit.Apms.Terminal.Wpf.Test.CodedUITest1: Microsoft.VisualStudio.TestTools.UITest.Extension.UITestException: To run tests that interact with the desktop, you must set up the test agent to run as an interactive process. For more information, see "How to: Set Up Your Test Agent to Run Tests That Interact with the Desktop" (http://go.microsoft.com/fwlink/?LinkId=255012)
If you are running the tests as part of your team build, you must also set up the build agent to run as an interactive process. For …Run Code Online (Sandbox Code Playgroud) 我试图在QTP上执行我的Coded UI脚本.首先我为我的Coded UI项目创建了一个dll后来我能够从该dll访问方法,但我无法访问Coded UI测试方法.示例:以下脚本位于VSTS中的C#中
namespace TestProject1
{
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Input;
using System.Windows.Forms;
using System.CodeDom.Compiler;
using System.Text.RegularExpressions;
using Microsoft.VisualStudio.TestTools.UITest.Extension;
using Microsoft.VisualStudio.TestTools.UITesting;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Keyboard = Microsoft.VisualStudio.TestTools.UITesting.Keyboard;
using Mouse = Microsoft.VisualStudio.TestTools.UITesting.Mouse;
using MouseButtons = System.Windows.Forms.MouseButtons;
using Microsoft.VisualStudio.TestTools.UITesting.WinControls;
using Microsoft.VisualStudio.TestTools.UITesting.HtmlControls;
using Microsoft.VisualStudio.TestTools.UITesting.WpfControls;
public partial class UIMap
{
public int MyInteger()
{
return 9;
}
public string testDll()
{
return "Test DLL Factory";
}
public void add1()
{
MessageBox.Show("Sravan");
}
public void DeletePhoto()
{
WinWindow window = new …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用vs2013终极版使用编码ui-test项目自动测试Windows应用程序.
我可以看到测试类别下的C#桌面应用程序和Windows Phone类别下的电话应用程序的模板.
我无法看到Windows Universal Apps的此类模板.
如何自动化通用应用程序?
如果我选择类别Store Apps - > Coded UI Test Project(Windows)下可用的编码ui模板

项目创建后,记录器给我一条消息"Windows商店应用程序不支持录制操作步骤"
我想找一个UIView XCUIElement,但我似乎找不到它.这个UIView用于向用户显示某些信息,我需要能够在某些情况下测试它是否在屏幕上.我将view.userInteractionEnabled设置为YES.
我已经尝试点击'记录'并选择它,但它似乎不可选,因为当我点击它时它不会编写代码来找到它.
我已尝试以编程方式定位它,但XCUIElementType Any和Other似乎没有找到它,我没有看到更合适的View.
我已经尝试在故事板中设置可访问性,但是在运行单元测试时,所有可访问性似乎都消失了.
这似乎应该是非常基本的,如果我在这里错过了什么,那就很抱歉.
我们正在使用cypress编写UI测试,这通常很容易使用。但是我一次又一次地遇到了一个乏味的等待问题。
场景非常简单。用户单击搜索按钮。然后,他选择具有特定文本的元素之一。这是代码:
cy.get('#search-button').click();
cy.contains('Test item 1').click();
cy.get('#cheapest-offer-button').click();
Run Code Online (Sandbox Code Playgroud)
第三次click事件失败,因为已经cy.contains('Test item 1')不等待页面和元素被渲染。根据我在测试步骤中看到的内容,它只需单击页面中间的按钮,实际上什么也没做。因此,所有后续步骤当然会失败。
但是,如果我wait()在这样的调用之间添加一个:
cy.get('#search-button').click();
cy.wait(2000);
cy.contains('Test item 1').click();
cy.get('#cheapest-offer-button').click();
Run Code Online (Sandbox Code Playgroud)
页面正确呈现,Test item 1出现,被单击,随后的所有步骤均成功。
根据最佳实践,该wait()呼叫不是必需的,因此应避免。我在这里做错了什么?
coded-ui-tests ×10
c# ×4
testing ×2
wpf ×2
.net ×1
cypress ×1
html ×1
qtp ×1
silverlight ×1
specflow ×1
swift ×1
swift2 ×1
teamcity ×1
teamcity-8.0 ×1
vb.net ×1