简体   繁体   English

使用Visual Studio 2012对测试框架Telerik进行自动化测试

[英]Automated testing with Visual Studio 2012 for test framework telerik

How do I generate a test in Visual Studio 2012 with the framework of telerik for this command line: 如何在Visual Studio 2012中使用Telerik框架为此命令行生成测试:

<span class = "widget-k k k-dropdown-header" style = "width: 100%;" unselectable = "on" role = "listbox" aria-haspopup = "true" aria-expanded = "false" tabindex = "0" = aria-owns "IdCorPinturaTipo_listbox" aria-disabled = "false" aria-readonly = "false" aria-busy = "false" aria-activedescendant = "IdCorPinturaTipo_option_selected">
<span class="k-dropdown-wrap k-state-default" unselectable="on">
<span class="k-input" unselectable="on"> PEROLIZADA </ span>
<span class="k-select" unselectable="on">
<span class="k-icon ki-arrow-s" unselectable="on"> select </ span>
</ span>
</ span>
<input id="IdCorPinturaTipo" type="text" style="width: 100%; display: none;" name="IdCorPinturaTipo" data-role="dropdownlist">
</ span>

Since the information is from a dropdownList and want to generate test information PEROLIZADA. 由于该信息来自下拉列表,并且要生成测试信息PEROLIZADA。

I've tried several codes to generate this line: 我尝试了一些代码来生成此行:

<span class="k-input" unselectable="on"> PEROLIZADA </ span>

This is one of the examples that I tried to generate test the above information. 这是我尝试生成的测试上述信息的示例之一。

Find.ByExpression<HtmlAnchor>("class=k-input", "unselectable=on", "tabindex=-1", "id=IdCorPinturaTipo_option_selected").InnerText("PEROLIZADA");

Take a look at this approach . 看看这种方法 There is detailed information in the wiki . Wiki中有详细信息。

string str = "PEROLIZADA"; 字符串str =“ PEROLIZADA”; Find.ByExpression("class=k-input", "unselectable=on", "textcontent="+str); Find.ByExpression(“ class = k-input”,“ unselectable = on”,“ textcontent =” + str);;

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

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