coded-ui-tests

What is the difference between using System.Windows.Automation and Microsoft.VisualStudio.TestTools.UITesting for WPF UI Test automation?

旧时模样 提交于 2019-12-04 03:54:44
What is the difference between using System.Windows.Automation (commonly known as UIA) API and Microsoft.VisualStudio.TestTools.UITesting (one that is used in Coded UI Test behind the scene) for implementing UI Test automation of a WPF application programatically? Is there any specific scenarios, restrictions or advantages/disadvantages? In fact, the answer is in your question. UIA is used for automation, while UITesting is used for... testing. An excerpt from MSDN: UI Automation provides programmatic access to most user interface (UI) elements on the desktop, enabling assistive technology

Writing Custom HTML Logs

那年仲夏 提交于 2019-12-04 00:59:59
My Coded UI Test is configured so that the output of the test automatically produces an HTML log file, the instructions for doing this can be seen here . Is there any way to customize this HTML log or make my own HTML logger so that mine is used to produce the log instead? For instance the default HTML log only shows Assert events if they fail. I would like Assert events to be shown even if they don't fail. I would like to use the default HTML logger as a base as it already does almost exactly what I need, I'm not looking for a solution such as create my own output messages during the test

Hand Coding Coded UI Tests [closed]

淺唱寂寞╮ 提交于 2019-12-03 12:15:12
Closed. This question is off-topic. It is not currently accepting answers. Learn more . Want to improve this question? Update the question so it's on-topic for Stack Overflow. Hi I am looking at using Coded UI Tests (CUIT) to test an application. I have tried the recording option and this is not flexible enough for me. If you use it on a different size screen it breaks. I know you can hand code the tests but I cannot find any good examples of how to write a basic test. There are examples on here that use CUITe but these posts are from 2011 and I'm not sure how relevant they are anymore with

How to use AutomationProperties.Name?

廉价感情. 提交于 2019-12-03 11:30:15
Question Can anyone please explain (preferrably with a code example) how the AutomationProperties.Name property is used programmatically and declaratively with XAML? Explanation I understand that the Coded UI Builder in Visual Studio 2010, for instance, takes a Window's name as SearchProperty. Since my Window's name changes, I would like to have a constant SearchProperty that my Coded UI Tests can rely on. In the code example below, I don't want the window title to be hard-coded as "Properties of Pipe 1" since that changes. Code example [GeneratedCode("Coded UITest Builder", "10.0.30319.1")]

CodedUI tests - start a browser once for the entire set of tests

China☆狼群 提交于 2019-12-03 10:39:17
I'm writing some codedUI tests in VS2010 to test a web application. I'd like to be able to open the browser once for the entire set of tests in the solution and then close it again when the tests finish. I've tried AssemblyInitialize attribute on a method, with my BrowserWindow.Launch in there, but it gives me the following exception when I run it: Assembly Initialization method OrdersGridTesting.SuiteSetup.Login threw exception. Microsoft.VisualStudio.TestTools.UITest.Extension.TechnologyNotSupportedException: Microsoft.VisualStudio.TestTools.UITest.Extension.TechnologyNotSupportedException:

Is it possible to run Coded UI tests without having to connect via remote desktop?

爱⌒轻易说出口 提交于 2019-12-03 05:58:49
问题 I'm attempting to automate Coded UI tests. My test controller launches the tests on a remote test server, which I normally access via a Remote Desktop connection. Is it possible to run the Coded UI tests without having to connect via remote desktop? Currently, the tests only run when I have connected via Remote Desktop, and the window must be open. When I close the Remote Desktop session, the tests do not run. If it isn't possible to run coded UI tests without remote desktop, how can I

CodedUI How to pass values to a treeItem

心不动则不痛 提交于 2019-12-02 18:03:07
问题 In my winform application, there's a BrowseForFolder window. While recording a test method, I selected say C:\Folder1\MyData . However this path can be different and I am writing a method which takes the driveLetter, foldername and filename as parameters. These values should be the ones selected in the browserwindow. When I looked at the UIMap, there are treeitems. For instance, for drive name, its UILocalDiskCTreeItem . Search properties has the following: ControlType: TreeItem Name: Local

How to get path to UITestActionLog.html from code

落爺英雄遲暮 提交于 2019-12-02 14:56:37
问题 Each test case saves results to a separate UITestActionLog.html file. But in the end of each test case I'd like to move that .html to a different folder and rename it. Is it possible to do so in, say, [TestCleanup()]? If yes, then how can I programmatically get .html report location? 回答1: The TestContext class contains several fields with "directory" in their names. These can be used to access the various directories associated with running the tests. As well as managing the files as asked by

CodedUI dropdown selection

▼魔方 西西 提交于 2019-12-02 13:55:19
问题 I am trying to hand code my g mail signup form , i want to select month from drop down , but i was able to click the drop arrow by searching the properties from Test Builder.and not possible to find the property from month content , tried with Test Builder . can any one show me how to select that particular drop down Thank you , 回答1: I would suggest you let Coded UI show you what to do. Try creating a (sandbox) Coded UI project and use the Coded UI record and generate tool to perform the

How to get path to UITestActionLog.html from code

南楼画角 提交于 2019-12-02 09:55:17
Each test case saves results to a separate UITestActionLog.html file. But in the end of each test case I'd like to move that .html to a different folder and rename it. Is it possible to do so in, say, [TestCleanup()]? If yes, then how can I programmatically get .html report location? The TestContext class contains several fields with "directory" in their names. These can be used to access the various directories associated with running the tests. As well as managing the files as asked by your question the TestContext class has an AddResultFile method. The Microsoft documentation on this mehod