coded-ui-tests

Could not load file or assembly Operation is not supported. (Exception from HRESULT: 0x80131515)

混江龙づ霸主 提交于 2019-11-27 17:13:08
问题 When I run CodedUI Test from a small Console tool via vstest.console.exe from a scheduled task I sometimes see this error message on different PCs: error : Could not load file or assembly 'file:///C:\foobar.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515) Why/what is this not supported? 回答1: Right click on the Dll and unblock it. 回答2: During my research I found that this may happen when you downloaded a test in a ZIP from the internet and the

Coded UI Test is slow waiting for UI thread

别来无恙 提交于 2019-11-27 10:02:02
问题 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

CodedUI test does not read data from CSV input file

时光毁灭记忆、已成空白 提交于 2019-11-27 09:34:20
I am having difficulty mapping a CSV file with the Coded UI test method. This is most likely a stupid question but I cannot seem to find a solution for my problem, at least not one that works. I have made sure to set the property of the CSV file to Copy always . I have also imported the CSV file by writing the following line above the test method. [DataSource("Microsoft.VisualStudio.TestTools.DataSource.CSV", "|DataDirectory|\\Data\\login.csv", "login#csv", DataAccessMethod.Sequential), DeploymentItem("login.csv"), TestMethod] The file name is login.csv and it resides in the Data folder. The

Executing coded UI test from a standalone application

≡放荡痞女 提交于 2019-11-27 09:19:47
I found several blog posts about how to execute code UI tests using mstest utility, but I need to execute them from my C# application. I tried the simplest thing: I created a console application, added references to Microsoft.VisualStudio.TestTools.UITest.Logging.dll Microsoft.VisualStudio.TestTools.UITest.Playback.dll Microsoft.VisualStudio.TestTools.UITesting.dll and I tried calling UI test method from my application. I got the following error: The following is not a valid technology name: MSAA. To search for a control, you must specify a valid technology name. I tried referencing other

“control.Exists” within a loop works for first time and not for second time in coded ui

一个人想着一个人 提交于 2019-11-27 02:17:57
consider the code for(i = 0; i < 5; i++) { if(control.Exists) { mouse.Click(button); } } In this, control is a popup window. for the first time of execution, control.Exists = true and for the second time it is false though the control is present. Why is that so? How to make it to be true? Thanks in advance. Programs often draw another copy of a control, it looks identical to the eye but it is different. Hence the second time around the loop control refers to the old version of the control but it is no longer present. Your code is likely to be equivalent to for(i = 0; i < 5; i++) { if(top

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

限于喜欢 提交于 2019-11-27 02:08:43
问题 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

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

扶醉桌前 提交于 2019-11-26 23:42:37
问题 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,

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

孤街醉人 提交于 2019-11-26 23:38:15
问题 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. 回答1: The UIMap.designer.cs file is regenerated from the

CodedUI test does not read data from CSV input file

依然范特西╮ 提交于 2019-11-26 17:51:37
问题 I am having difficulty mapping a CSV file with the Coded UI test method. This is most likely a stupid question but I cannot seem to find a solution for my problem, at least not one that works. I have made sure to set the property of the CSV file to Copy always . I have also imported the CSV file by writing the following line above the test method. [DataSource("Microsoft.VisualStudio.TestTools.DataSource.CSV", "|DataDirectory|\\Data\\login.csv", "login#csv", DataAccessMethod.Sequential),

Executing coded UI test from a standalone application

耗尽温柔 提交于 2019-11-26 14:41:46
问题 I found several blog posts about how to execute code UI tests using mstest utility, but I need to execute them from my C# application. I tried the simplest thing: I created a console application, added references to Microsoft.VisualStudio.TestTools.UITest.Logging.dll Microsoft.VisualStudio.TestTools.UITest.Playback.dll Microsoft.VisualStudio.TestTools.UITesting.dll and I tried calling UI test method from my application. I got the following error: The following is not a valid technology name: