coded-ui-tests

while loop not exiting when value met

房东的猫 提交于 2019-12-13 08:58:06
问题 I have a scenario where I want to check the value of a cell in an application. When the value of the cell hits 0 or -1 I'd like the test to continue. So I have: while (!cell.Value.Equals("0") || !cell.Value.Equals("-1")) { Console.WriteLine("Value ({1})",cell_value.Value); Thread.Sleep(15000); } Unfortunately, when the cell reaches 0, it doesn't appear to 'break' out of the loop. Output: Value (20) Value (13) Value (10) Value (9) Value (4) Value (1) Value (0) Value (0) Value (0) Value (0) Is

How to use multiple assert in a test

≡放荡痞女 提交于 2019-12-13 06:38:59
问题 I have to work on a HTML page and verify the result (adding some texts, selecting some items from comboboxes, clicking on some button). For example action1, action2 and action3. After each action, I need to verify the result of the previous action. In QTP, we would use Report.Fail (Pass, warning) and go to the next action. Here in code UI, I'm using something like try{ Action1; Assert //some kind of assert Action2; Assert //some kind of assert Action3; Assert //some kind of assert } Catch

Run CodedUI test to automate actions

落花浮王杯 提交于 2019-12-13 06:37:41
问题 Is there a way of running CodedUI steps outside a test project? I want to use them to automate some actions in an application. 回答1: The program mstest.exe can be used to invoke Coded UI tests. Its /test:{test name} option allows a specific test (ie activity) to be executed, thus several different activities (ie tests) to be combined into one source file but only the desired activity is executed. Calling mstest.exe from a batch or Powershell script allows the activity to be executed without

How to run Coded UI Tests without Visual Studio 2010 Premium [closed]

狂风中的少年 提交于 2019-12-13 06:32:59
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I want to ask you if it is possible to build and run coded ui tests without Visual Studio 2010 Premium installed? Or can I just install Visual Studio 2010 Premium and use it command line without licensing? I know it works, but is the license ok with that? 回答1: Nope, you would need to license it. If you want to

Coded UI - UITestControlCollection using FindMatchingControls() is empty on consecutive runs

半腔热情 提交于 2019-12-13 04:48:32
问题 I use SpecFlow with Coded UI to create some automated functional tests for a WPF application. Let's see the following SpecFlow scenario: Scenario: Issue When Results button is pressed When Result 123 is selected When Results button is pressed When Result 123 is selected 1st and 3rd row parameter: Results 2nd and 4th row parameter: 123 Here are the methods for the upper mentioned steps: When Results button is pressed public void PressButton(string buttonName) { WpfButton uIButton = this.UIAUT

Assert windows closed in Coded UI Tests

南楼画角 提交于 2019-12-13 04:43:10
问题 I'm developing a set of coded UI tests for a WPF project. Does anyone know how to assert that a window was closed? I can't seem to check any properties of the window after it is gone. Should I assert the UI element is null, maybe? 回答1: The UITestControl class has a method called WaitForControlNotExist that did the trick! 来源: https://stackoverflow.com/questions/21489500/assert-windows-closed-in-coded-ui-tests

Coded UI - C# - time itemprop tag - how to validate year exists

回眸只為那壹抹淺笑 提交于 2019-12-13 04:23:01
问题 I received help from @dlatikay in a slightly different question yesterday, that helped me resolving false positive error partially. Here is the code snippet: string countCurrentYearQA = (string)(window.ExecuteScript("count = 0; if(document.body.innerText.toString().indexOf('" + nowYearQAString + "') > -1){count = 1;} return count.toString();")); string countPastYearQA = (string)(window.ExecuteScript("count = 0; if(document.body.innerText.toString().indexOf('" + pastYearQAString + "') > -1)

Customizing Visual Studio run configuration to run tests after launching application

﹥>﹥吖頭↗ 提交于 2019-12-13 03:42:12
问题 Here are the details of my Development Environment: Visual Studio 2012 Ultimate with Update 4 Google Chrome Version 38.0.2125.111 m Windows 7 Professional with 32-bit Operating System Coded UITest Builder 11.0.60315.1 Microsoft Coded UITest Project is within the ASP.NET Web Application Solution. We use the Microsoft Coded UITest Project to run Automated UI tests on the Web application. Here is what needs to be done. I need to build and run the ASP.NET Web Application Solution so that the Web

Coded ui test - Select an item from a combobox without using mouse coordinates

雨燕双飞 提交于 2019-12-13 02:40:33
问题 I am trying to pickup an item from a combobox by reverse engineering the code that i got from the coded uitest recorder. In the code it seems like the value is selected using the mouse coordinate However i would like to select the value using the combobox controler here are the two methodes first and the full code is below (many thanks for your help): public void CodedUITestMethod1() { // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and

How to install software automatically with Coded UI in C#

﹥>﹥吖頭↗ 提交于 2019-12-13 01:45:43
问题 I'm developing a tool which will automatically install a software in PC. I'm trying to do this with Coded UI in visual studio 2013. To install the software I need to click on the "Next" button on setup window. But when I click on the button its showing a warning - Access to the application is denied Here is the screenshot of the issue - How can i automate the process? Is there any better approach rather than Coded UI that I should think about to install the software automatically? 回答1: Just