0

如何在 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>

由于信息是从一个下拉列表中生成的,所以要生成测试信息PEROLIZADA。

我尝试了几个代码来生成这一行:

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

这是我尝试生成测试上述信息的示例之一。

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

2 回答 2

0

看看这个方法wiki中有详细信息。

于 2014-09-28T11:12:42.357 回答
-2

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

于 2013-09-16T18:24:59.893 回答