简体   繁体   English

Visual Studio 2013编码的UI无法识别单选按钮

[英]Visual Studio 2013 Coded UI failing to recognise Radio buttons

I'm currently using Visual Studio 2013 to automate some basic tests on a webpage, such as entering and deleting text in text fields within the webpage etc. 我目前正在使用Visual Studio 2013自动化网页上的一些基本测试,例如在网页内的文本字段中输入和删除文本等。

One of the tests I'd like to complete, is via the use of Radio buttons, to select gender (M/F/O). 我要完成的一项测试是通过使用单选按钮来选择性别(M / F / O)。 However, the click for this selection always fails with an exception: 但是,此选择的单击始终失败,但有以下例外:

Test Name:    CodedUITestMethod1
Test Outcome: Failed

Result Message: 

Microsoft.VisualStudio.TestTools.UITest.Extension.FailedToPerformActionOnHiddenControlException: Cannot perform 'SetProperty of Selected with value "True"' on the hidden control. Additional Details: 
TechnologyName:  'Web'
ControlType:  'RadioButton'
TagName:  'INPUT'
Id:  'ContentPlaceHolder1_customers_general1_rblGender_1'
Name:  'ctl00$ContentPlaceHolder1$customers_general1$rblGender'
 ---> System.Runtime.InteropServices.COMException: Exception from HRESULT: 0xF004F002

I note that there are several instances of similar failures reported on the internet, some to do with Microsoft security patch KB2870699 - which I don't see listed in my patches. 我注意到互联网上报告了一些类似故障的实例,其中一些与Microsoft安全补丁KB2870699有关-我的补丁中未列出这些补丁。

Many of the other reported issues seem to be 'more bespoke' than 'general'. 其他许多已报告的问题似乎比“一般”更“定制”。

Is there a 'more general' issue out there that causes this issue, for which there may be a simple fix? 是否存在导致此问题的“更普遍”的问题,对此可能有一个简单的解决方法?

Has this Microsoft security patch KB2870699 been superceeded? 此Microsoft安全补丁KB2870699是否已被取代?

At a loss to see how these Radio buttons don't work while other aspects on the same page under test function as expected. 不知所措地看到了这些单选按钮如何工作,而同一页面上的其他方面在被测之下却按预期运行。

These particular Radio Buttons, I have never had to function at all. 这些特殊的单选按钮,我根本不需要起作用。

the error you are given: "Cannot perform 'SetProperty of Selected with value "True"' on the hidden control" suggest there is some other control that is blocking the radio button and prevents you from setting it. 您得到的错误是:“无法在隐藏的控件上执行值为'True'的'Selected'SetProperty of Selected'”,表明存在其他一些控件正在阻止单选按钮并阻止您对其进行设置。 try checking perhaps there is a toolTip or something related that is blocking your control. 请尝试检查是否有一个ToolTip或其他相关内容阻止了您的控制。

if you could post the rest of the code that might help understanding the problem better. 如果您可以发布其余代码,这可能有助于更好地理解问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM