coded-ui-tests

How to detect that narrator tool is running?

坚强是说给别人听的谎言 提交于 2019-12-06 07:10:56
问题 I have a custom control. i like to provide the support for System screen reading support. Is there any logic to find that the narrator or coded UI tool is enabled in our machine.?? 回答1: You can use namespace Windows.UI.Xaml.Automation.Peers and this method: var isNarratorStarted = AutomationPeer.ListenerExists(AutomationEvents.AutomationFocusChanged); 回答2: I had similiar case but when working with UWP app and I solved it that way. Maybe you can take something from here: private bool

Coded UI Test now gets error about Newtonsoft.json not being found

白昼怎懂夜的黑 提交于 2019-12-06 06:48:27
I have a simple Coded UI test to log into an application. The test is data driven and uses data from TFS. We are using a TfsTestAgent user (that has admin privileges) that is on both the server and the agent systems. When I execute the test, I see the following error: The unit test adapter failed to connect to the data source or to read the data. For more information on troubleshooting this error, see "Troubleshooting Data-Driven Unit Tests" (http://go.microsoft.com/fwlink/?LinkId=62412) in the MSDN Library.Error details: Could not load file or assembly 'Newtonsoft.Json, Version=4.5.0.0,

How do I get ItemStatus from a UITestControl?

≯℡__Kan透↙ 提交于 2019-12-06 05:34:36
The UI Automation framework has a base class, AutomationElement , that has a property, ItemStatus , that can be used to store arbitrary strings. I'm trying to get that property from the Visual Studio 2010 Coded UI Tests base class, UITestControl . Look at the Coded UI Tests generated code for WpfControl . It has a property, NativeElement. This property is an AutomationElement . public abstract class WpfControl : UITestControl { ... public virtual object NativeElement { get { return ((object)(this.GetProperty(UITestControlProperties.Common.NativeElement))); } } ... } You can write an extension

TF400813: Resource not available for anonymous access. Client authentication required

元气小坏坏 提交于 2019-12-06 04:28:47
I am working on the CodedUI Test Automation project. i am developing a framework in which i am trying to access Test Cases in VSTS through RestAPI . I have worked on an MVC application previously in which i did the same thing to pull data from VSTS using RestAPI . Now the problem is i am not able to access the VSTS . Everytime i am trying to access the VSTS , i got the exception TF400813: Resource not available for anonymous access. Client authentication required . I am using the same PAT token . I have all the required access on my team project. I am able to access all work items in my

VS 2010, Coded UI Tests: Re-run failed test cases

我的未来我决定 提交于 2019-12-06 03:39:53
I'm using VS2010 Premium, Coded UI Tests. Do you know how to re-execute failed test cases after run? If test was passed after re-execution then it should be passed in result report. Not so optimal way but you could put all your code to try/catch block and rerun the test if an exception is thrown: [CodedUITest] public class CodedUITest { private static int _maxTestRuns = 5; [TestCleanup] public void Cleanup() { //If the test has reached the max number of executions then it is failed. if (_maxTestRuns == 0) Assert.Fail("Test executed {0} times and it was failed", _maxTestRuns); } [TestMethod]

Writing Custom HTML Logs

白昼怎懂夜的黑 提交于 2019-12-05 14:38:12
问题 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

Visual Studio 2012 Coded UI Testing of Web Application - Code coverage

无人久伴 提交于 2019-12-05 08:29:53
I have a web application. I am using VS 2012 Coded UI for testing the web application. I have recorded the test and running it, and it works fine. But the code coverage window gives code coverage of the test project only, it doesnt give code coverage of the website project and other dll project which is referred in the web project. I have added the testsetting file in the solution and selected the same. Any clue? Couple of things to verify a) Have you added all these assemblies into the code coverage configuration's list of assemblies via the testsettings? b) Is your deployment of the web app

Why should we use coded ui when we have Specflow?

陌路散爱 提交于 2019-12-05 03:30:01
We have utilized Specflow and WatIn for acceptance tests at my current project. The customer wants us to use Microsoft coded-ui instead. I have never tested coded ui, but from what I've seen so far it looks cumbersome. I want to specify my acceptance tests up front, before I have a ui, not as a result of some record/playback stuff. Anyway, can someone please tell me why we should throw away the Specflow/watin combo and replace it with coded ui? I've also read that you can combine specflow with coded ui, but it looks like a lot of overhead for something which I am already doing fine in specflow

Any way to automate SFSafariViewController in UI tests?

血红的双手。 提交于 2019-12-05 01:55:09
Is there any way to automate SFSafariViewController? I like the Xcode 7 UI test feature, but it seems it does not support SFSafariViewController automation. Some of the UI flows I am testing require a web browser so the app uses SFSafariViewController to make it safer vs a web view. If it's similar to launching extensions (currently broken with direct interactions), try tapping the screen at the point where the element you're looking for is: Example of tapping an action sheet which launches an extension: func tapElementInActionSheetByPosition(element: XCUIElement!) { let tableSize = app.tables

Coded UI tests - cannot resolve symbol UITesting

雨燕双飞 提交于 2019-12-04 23:26:25
问题 I'm trying to use the assemblies like this in a VS2012 project: using Microsoft.VisualStudio.TestTools.UITesting; using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.VisualStudio.TestTools.UITest.Extension; However I get a bunch of red in my tests: I can build and run locally even with this red, but I'd like to get this stuff resolving if possible. My build machine rejects this with the following errors: DashboardTest.cs (7): The type or namespace name 'UITesting' does not