coded-ui-tests

How to access TestRunParameters within RunSettings file

六眼飞鱼酱① 提交于 2019-11-28 17:26:58
问题 Reading through https://msdn.microsoft.com/en-us/library/jj635153.aspx I have created a .RunSettings files with a few parameters similar to the example: <TestRunParameters> <Parameter name="webAppUrl" value="http://localhost" /> <Parameter name="webAppUserName" value="Admin" /> <Parameter name="webAppPassword" value="Password" /> </TestRunParameters> I plan on having a .RunSettings file for each of our environments with appropriate URLs and credentials for running a CodedUI test on the

Coded UI Test is slow waiting for UI thread

寵の児 提交于 2019-11-28 16:52:56
I've added Coded UI Tests to my ASP.NET MVC solution in Visual Studio 2013. I was dismayed to see how slowly the tests run; each page just sits there for up to a minute or more before the test machinery wakes up and starts filling in the form fields. After some experimentation (including turning off SmartMatch ), I've discovered that simply calling Playback.PlaybackSettings.WaitForReadyLevel = WaitForReadyLevel.Disabled; solves the problem. But, as expected, the test frequently fails because the UI thread isn't ready for the test machinery to interact with the controls on the form. Calling

How to refresh UIMap object in CodedUI

China☆狼群 提交于 2019-11-28 11:21:52
问题 Can i refresh UIMap object ? Problem is I change the location of UI element on and I again try to get the AutomationElement at that time I get AutomationELment but its BoundingRectanle is infinity. So i am assuming that it is not refreshing the UIMap object. Can anyone please help me on this ? 回答1: In the UIMaps section of your test, you have probably something like: private MyTestUIMap uiMap; public MyTestUImap UIMap { get { if (this.uiMap == null) { this.uiMap = new MyTestUIMap(); } return

Interacting with multiple instances of an application in Coded UI

青春壹個敷衍的年華 提交于 2019-11-28 10:15:28
问题 The scenario that I am facing is that I am trying to write a single test which will use Coded UI to interact with multiple instances of the same application, in this case Microsoft Excel. In other words, there will be multiple Excel workbooks open in multiple windows, and I need to be able to direct Coded UI to interact with a specific instance programatically. I initially thought this type of instance management would be a function of the ApplicationUnderTest class, but it is not obvious how

Running Coded UI test remotely

眉间皱痕 提交于 2019-11-28 09:17:33
I have to run Coded UI test remotely on a VM. I am using Mstest.exe to execute the test cases. Now when i run it , through Windows scheduler , it fails because it need "Active Desktop ". I read it a few places that we need to use test agent. But i dont want to configure test agent and test controller just to set "Active desktop", Is their something else that i can do ? Well there is no hard in setting up a test controler and a test agent, it is really easy and its the best way to go. You can find the installation guidelines here: http://msdn.microsoft.com/en-us/library/dd293551.aspx However,

How to send keys Control + A + B? (keep Control modifier “pressed”)

安稳与你 提交于 2019-11-28 08:08:52
问题 When I record this sequence it fails. I know I can send Control + A using Keyboard.SendKeys(control, "A",ModifierKeys.Control) but how do I send a sequence that holds control and releases the letter before pressing the next letter. Note: the sequence I am looking for is similar to the default Visual Studio shortcut for commenting out a line Control + K + C Is this maybe something that I just need to use the WinApi for? 回答1: keybd_event is very convenient for this (much easier to use than the

How to exclude certain tests in the Visual Studio Test Runner?

浪尽此生 提交于 2019-11-28 08:03:53
I have attributes on certain tests that I ideally don't want to run on every build. Most of my tests are normal unit tests and I do want them to run on every build. So: how can I exclude a test by category or project type? For example, I'd like to exclude CodedUItests : [CodedUITest] public class SearchViewTests ...or exclude tests in a given TestCategory : [TestMethod] [TestCategory("Database Integration")] public void ContactRepositoryGetByIdWithIdExpectCorrectContact() I particularly want to exclude the coded UI tests as they disrupt my ability to continue working, whereas all the other

Getting list of tests from Test Explorer in VS

青春壹個敷衍的年華 提交于 2019-11-28 07:22:07
问题 This is kind of a "high level"/simple question. I'm trying to get just a list of all the tests that are populated in my Test Explorer in VS2012. I'd like to compare it to a list of tests and I was wondering if there is any way to just get all the names out of the Test Explorer, like a copy/paste, export to csv or anything of that nature. 回答1: Select all tests in Test Explorer and add them to a playlist file. Playlist feature needs VS 2012 Update 2. See http://msdn.microsoft.com/en-us/library

CodedUI “FindMatchingControls()” works 10% of the time but usually returns about half of the controls

我怕爱的太早我们不能终老 提交于 2019-11-28 02:25:53
Problem: I am using FindMatchingControls() to create a Collection of rows in a WPF table. I have written a loop that will set the ComboBox in each row to a given value. The whole thing works sometimes but more often than not, FindMatchingControls() actually finds about half of the rows. How can I configure timeouts or change settings to make it find all 50 controls every time or perhaps to find the first 10 and then to find the next 10 etc? Background : I am testing a WPF window and on it, there's a table, each row in the table has a drop down list. There are 50 rows and in future there could

Why is it bad to edit the UIMap.designer.cs file in a Visual Studio Coded UI test?

送分小仙女□ 提交于 2019-11-28 02:06:39
I have read that it is bad to edit the UIMap.Designer.cs file, however, I do not understand why. Per MSDN: "Do not modify the UIMap.designer.cs file directly. If you do this, the changes to the file will be overwritten." http://msdn.microsoft.com/en-us/library/dd380782.aspx Does anybody know what gets overwritten? Does this mean that if the UIMap.uitest file is edited after the Designer file, the designer file gets reversed? please help. The UIMap.designer.cs file is regenerated from the UIMap.uitest file after every edit (that is saved) to the UIMap.uitest file. There is a comment at the top