复选框 [英] checkbox
问题描述
大家
我想选择编码的UI手动编码中的复选框,但没有找到任何人可以帮助我的方式吗?
Hi Biu Ahmed,
欢迎来到MSDN论坛。
在编码的UI,我们可以使用搜索属性来选择我们需要的控件。如果您有许多类似的控件,则搜索属性必须是搜索控件的唯一标记。
如果UI测试适用于Web表单,请参阅简单示例:
使用Microsoft.VisualStudio.TestTools.UITesting;
BrowserWindow browser = BrowserWindow.Launch(" http:// localhost:2993 / WebForm1.aspx");
browser.Maximized = true;
UITestControl uicheckbox = new UITestControl(browser);
uicheckbox.TechnologyName =" Web" ;;
uicheckbox.SearchProperties.Add(" ControlType"," CheckBox");
Mouse.Click(uicheckbox);
如果UI测试是针对win表单的,请参阅简单示例:
使用Microsoft.VisualStudio.TestTools.UITesting;
使用Microsoft.VisualStudio.TestTools.UITesting.WinControls;
ApplicationUnderTest测试= ApplicationUnderTest.Launch(QUOT; d:\\Coded UI Test\\CodedUITestProject4\\WindowsFormsApp1\\bin\\Debug\\WindowsFormsApp1。 exe文件");
WinCheckBox uICheckBox = new WinCheckBox(test);
uICheckBox.TechnologyName =" MSAA" ;;
uICheckBox.SearchProperties.Add(" ControlType"," CheckBox");
Mouse.Click(uICheckBox);请点击 其他有关UItesting SDK的更多信息。希望它可以帮到你。
最好的问候,
Dylan
hi all
i want to select the checkbox in coded UI manual coding but did not find the way can anyone help me in this ?
Hi Biu Ahmed,
Welcome to MSDN forum.
In the coded UI, we could use search property to select the controls we need. If you have many similar controls, the search property must be a unique token for the search control.
If the UI test is for web form, please refer to the simple sample:
using Microsoft.VisualStudio.TestTools.UITesting;
BrowserWindow browser = BrowserWindow.Launch("http://localhost:2993/WebForm1.aspx"); browser.Maximized = true; UITestControl uicheckbox = new UITestControl(browser); uicheckbox.TechnologyName = "Web"; uicheckbox.SearchProperties.Add("ControlType", "CheckBox"); Mouse.Click(uicheckbox);
If the UI test is for win form, please refer to the simple sample:
using Microsoft.VisualStudio.TestTools.UITesting;
using Microsoft.VisualStudio.TestTools.UITesting.WinControls;ApplicationUnderTest test = ApplicationUnderTest.Launch("D:\\Coded UI Test\\CodedUITestProject4\\WindowsFormsApp1\\bin\\Debug\\WindowsFormsApp1.exe"); WinCheckBox uICheckBox = new WinCheckBox(test); uICheckBox.TechnologyName = "MSAA"; uICheckBox.SearchProperties.Add("ControlType", "CheckBox"); Mouse.Click(uICheckBox);
please click here for more information about UItesting SDK. Hope it can help you.
Best Regards,
Dylan
这篇关于复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!